testparse.c
branchtrunk
changeset 100 2b88649b6f98
parent 97 4a41e3d17297
child 113 8ebf445c5305
--- a/testparse.c	Fri Apr 04 14:46:51 2008 -0400
+++ b/testparse.c	Sat Apr 05 08:21:53 2008 -0400
@@ -55,6 +55,29 @@
         printf("SHADER TYPE: %s\n", shader_type(pd->shader_type));
         printf("VERSION: %d.%d\n", pd->major_ver, pd->minor_ver);
         printf("INSTRUCTION COUNT: %d\n", (int) pd->instruction_count);
+
+        printf("ATTRIBUTES:");
+        if (pd->attribute_count == 0)
+            printf(" (none.)\n");
+        else
+        {
+            int i;
+            printf("\n");
+            for (i = 0; i < pd->attribute_count; i++)
+            {
+                static const char *usagenames[] = {
+                    "position", "blendweight", "blendindices", "normal",
+                    "psize", "texcoord", "tangent", "binormal", "tessfactor",
+                    "positiont", "color", "fog", "depth", "sample"
+                };
+                const MOJOSHADER_attribute *a = &pd->attributes[i];
+                char numstr[16] = { 0 };
+                if (a->index != 0)
+                    snprintf(numstr, sizeof (numstr), "%d", a->index);
+                printf("    * %s%s\n", usagenames[(int) a->usage], numstr);
+            } // for
+        } // else
+
         printf("UNIFORMS:");
         if (pd->uniform_count == 0)
             printf(" (none.)\n");