Handle MOJOSHADER_USAGE_NORMAL in Metal profile
authorCaleb Cornett <caleb.cornett@outlook.com>
Wed, 20 Nov 2019 13:36:32 -0500
changeset 1217 065dcf3eed9c
parent 1216 9d725de6c61c
child 1218 063ee7ba5eea
Handle MOJOSHADER_USAGE_NORMAL in Metal profile
profiles/mojoshader_profile_metal.c
--- a/profiles/mojoshader_profile_metal.c	Wed Oct 30 00:29:02 2019 -0400
+++ b/profiles/mojoshader_profile_metal.c	Wed Nov 20 13:36:32 2019 -0500
@@ -918,6 +918,8 @@
                 case MOJOSHADER_USAGE_TEXCOORD:
                     output_line(ctx, "float4 %s [[user(texcoord%d)]];", var, index);
                     break;
+                case MOJOSHADER_USAGE_NORMAL:
+                    output_line(ctx, "float4 %s [[user(normal)]];", var);
                 default:
                     // !!! FIXME: we need to deal with some more built-in varyings here.
                     break;
@@ -1023,6 +1025,9 @@
 
                 else if (usage == MOJOSHADER_USAGE_FOG)
                     output_line(ctx, "float4 %s [[user(fog)]];", var);
+
+                else if (usage == MOJOSHADER_USAGE_NORMAL)
+                    output_line(ctx, "float4 %s [[user(normal)]];", var);
             } // else
 
             pop_output(ctx);