Handle MOJOSHADER_USAGE_UNKNOWN in SPIR-V linker
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Tue, 25 Aug 2020 22:41:43 -0400
changeset 1300 f1cdc5187d53
parent 1299 02d36217591b
child 1301 79bbc92200dc
Handle MOJOSHADER_USAGE_UNKNOWN in SPIR-V linker
mojoshader_common.c
--- a/mojoshader_common.c	Thu Jul 23 18:16:22 2020 -0400
+++ b/mojoshader_common.c	Tue Aug 25 22:41:43 2020 -0400
@@ -1073,6 +1073,8 @@
     for (i = 0; i < pixel->attribute_count; i++)
     {
         const MOJOSHADER_attribute *pAttr = &pixel->attributes[i];
+        if (pAttr->usage == MOJOSHADER_USAGE_UNKNOWN)
+            continue; // Probably something like VPOS, ignore!
         if (pAttr->usage == MOJOSHADER_USAGE_COLOR && pAttr->index == 0)
             continue;
 
@@ -1089,6 +1091,7 @@
     for (i = 0; i < vertex->output_count; i++)
     {
         const MOJOSHADER_attribute *vAttr = &vertex->outputs[i];
+        assert(vAttr->usage != MOJOSHADER_USAGE_UNKNOWN);
         if (vAttr->usage == MOJOSHADER_USAGE_POSITION && vAttr->index == 0)
             continue;
         if (vAttr->usage == MOJOSHADER_USAGE_POINTSIZE && vAttr->index == 0)