Fixed DCL'ing of vFace and vPos registers in D3D profile. trunk
authorRyan C. Gordon <icculus@icculus.org>
Mon, 12 May 2008 02:25:22 -0400
branchtrunk
changeset 318 a366c6191737
parent 317 74a9f3ae4534
child 319 86645710b4a5
Fixed DCL'ing of vFace and vPos registers in D3D profile.
mojoshader.c
--- a/mojoshader.c	Mon May 12 02:23:33 2008 -0400
+++ b/mojoshader.c	Mon May 12 02:25:22 2008 -0400
@@ -1498,8 +1498,7 @@
 
     if (arg->regtype == REG_TYPE_SAMPLER)
     {
-        const TextureType ttype = (const TextureType) ctx->dwords[0];
-        switch (ttype)
+        switch ((const TextureType) ctx->dwords[0])
         {
             case TEXTURE_TYPE_2D: usage_str = "_2d"; break;
             case TEXTURE_TYPE_CUBE: usage_str = "_cube"; break;
@@ -1508,6 +1507,18 @@
         } // switch
     } // if
 
+    else if (arg->regtype == REG_TYPE_MISCTYPE)
+    {
+        switch ((const MiscTypeType) arg->regnum)
+        {
+            case MISCTYPE_TYPE_POSITION:
+            case MISCTYPE_TYPE_FACE:
+                usage_str = "";  // just become "dcl vFace" or whatever.
+                break;
+            default: fail(ctx, "unknown misc register type"); return;
+        } // switch
+    } // else if
+
     else
     {
         const uint32 usage = ctx->dwords[0];