mojoshader.c
branchtrunk
changeset 419 8c4cee0c6a82
parent 418 54a98b5f6c16
child 421 bfd3d95273ec
--- a/mojoshader.c	Wed Jul 02 15:44:51 2008 -0400
+++ b/mojoshader.c	Wed Jul 02 16:00:47 2008 -0400
@@ -7335,10 +7335,11 @@
                                       (TextureType) item->index);
     } // for
 
-    // ...and attributes... (find POSITION0 here, so it's always first).
+    // ...and attributes... (find input POSITION0 here, so it's always first).
     for (item = ctx->attributes.next; item != NULL; item = item->next)
     {
-        if ((item->usage == MOJOSHADER_USAGE_POSITION) && (item->index == 0))
+        if ( (item->regtype == REG_TYPE_INPUT) &&
+             (item->usage == MOJOSHADER_USAGE_POSITION) && (item->index == 0) )
         {
             ctx->attribute_count++;
             ctx->profile->attribute_emitter(ctx, item->regtype, item->regnum,
@@ -7348,10 +7349,11 @@
         } // if
     } // for
 
-    // ...and attributes... (everything but POSITION0).
+    // ...and attributes... (everything but input POSITION0).
     for (item = ctx->attributes.next; item != NULL; item = item->next)
     {
-        if ((item->usage != MOJOSHADER_USAGE_POSITION) || (item->index != 0))
+        if ( (item->regtype != REG_TYPE_INPUT) ||
+             (item->usage != MOJOSHADER_USAGE_POSITION) || (item->index != 0) )
         {
             ctx->attribute_count++;
             ctx->profile->attribute_emitter(ctx, item->regtype, item->regnum,