tgsi: show textual format representation
[mesa.git] / src / gallium / auxiliary / tgsi / tgsi_text.c
index ef43ebc661945ddc291bb42015e1b353672ddb29..91baa01ad8bdebad44ec44ba43f9d7a5166080d2 100644 (file)
@@ -1290,8 +1290,6 @@ static boolean parse_declaration( struct translate_ctx *ctx )
             return FALSE;
          }
 
-         /* XXX format */
-
          cur2 = cur;
          eat_opt_white(&cur2);
          while (*cur2 == ',') {
@@ -1304,7 +1302,16 @@ static boolean parse_declaration( struct translate_ctx *ctx )
                decl.Image.Writable = 1;
 
             } else {
-               break;
+               for (i = 0; i < PIPE_FORMAT_COUNT; i++) {
+                  const struct util_format_description *desc =
+                     util_format_description(i);
+                  if (desc && str_match_nocase_whole(&cur2, desc->name)) {
+                     decl.Image.Format = i;
+                     break;
+                  }
+               }
+               if (i == PIPE_FORMAT_COUNT)
+                  break;
             }
             cur = cur2;
             eat_opt_white(&cur2);