testparse.c
branchtrunk
changeset 100 2b88649b6f98
parent 97 4a41e3d17297
child 113 8ebf445c5305
equal deleted inserted replaced
99:20d0bb294e9e 100:2b88649b6f98
    53     else
    53     else
    54     {
    54     {
    55         printf("SHADER TYPE: %s\n", shader_type(pd->shader_type));
    55         printf("SHADER TYPE: %s\n", shader_type(pd->shader_type));
    56         printf("VERSION: %d.%d\n", pd->major_ver, pd->minor_ver);
    56         printf("VERSION: %d.%d\n", pd->major_ver, pd->minor_ver);
    57         printf("INSTRUCTION COUNT: %d\n", (int) pd->instruction_count);
    57         printf("INSTRUCTION COUNT: %d\n", (int) pd->instruction_count);
       
    58 
       
    59         printf("ATTRIBUTES:");
       
    60         if (pd->attribute_count == 0)
       
    61             printf(" (none.)\n");
       
    62         else
       
    63         {
       
    64             int i;
       
    65             printf("\n");
       
    66             for (i = 0; i < pd->attribute_count; i++)
       
    67             {
       
    68                 static const char *usagenames[] = {
       
    69                     "position", "blendweight", "blendindices", "normal",
       
    70                     "psize", "texcoord", "tangent", "binormal", "tessfactor",
       
    71                     "positiont", "color", "fog", "depth", "sample"
       
    72                 };
       
    73                 const MOJOSHADER_attribute *a = &pd->attributes[i];
       
    74                 char numstr[16] = { 0 };
       
    75                 if (a->index != 0)
       
    76                     snprintf(numstr, sizeof (numstr), "%d", a->index);
       
    77                 printf("    * %s%s\n", usagenames[(int) a->usage], numstr);
       
    78             } // for
       
    79         } // else
       
    80 
    58         printf("UNIFORMS:");
    81         printf("UNIFORMS:");
    59         if (pd->uniform_count == 0)
    82         if (pd->uniform_count == 0)
    60             printf(" (none.)\n");
    83             printf(" (none.)\n");
    61         else
    84         else
    62         {
    85         {