Skip to content

Commit

Permalink
Handle MOJOSHADER_USAGE_NORMAL in Metal profile
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpydog committed Nov 20, 2019
1 parent 7738438 commit ded4a9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions profiles/mojoshader_profile_metal.c
Expand Up @@ -918,6 +918,8 @@ void emit_METAL_attribute(Context *ctx, RegisterType regtype, int regnum,
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;
Expand Down Expand Up @@ -1023,6 +1025,9 @@ void emit_METAL_attribute(Context *ctx, RegisterType regtype, int regnum,

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);
Expand Down

0 comments on commit ded4a9e

Please sign in to comment.