--- a/profiles/mojoshader_profile_spirv.c Wed Jun 24 14:17:58 2020 -0400
+++ b/profiles/mojoshader_profile_spirv.c Wed Jun 24 14:19:28 2020 -0400
@@ -1516,8 +1516,13 @@
switch (usage)
{
case MOJOSHADER_USAGE_POSITION:
- assert(index == 0);
- spv_output_builtin(ctx, id, SpvBuiltInPosition);
+ if (index == 0)
+ spv_output_builtin(ctx, id, SpvBuiltInPosition);
+ else // locations [24,32]
+ {
+ assert(index < 10);
+ spv_output_location(ctx, id, 24 + (index - 1));
+ } // else
break;
case MOJOSHADER_USAGE_POINTSIZE:
spv_output_builtin(ctx, id, SpvBuiltInPointSize);
@@ -1688,6 +1693,10 @@
case MOJOSHADER_USAGE_NORMAL:
spv_output_location(ctx, id, 14 + index);
break;
+ case MOJOSHADER_USAGE_POSITION:
+ assert(index > 0 && index < 10);
+ spv_output_location(ctx, id, 24 + (index - 1));
+ break;
default:
failf(ctx, "unexpected attribute usage %d in pixel shader", usage);
break;