tgsi: show textual format representation
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 9 Jan 2016 06:04:08 +0000 (01:04 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 16 Feb 2016 03:22:33 +0000 (22:22 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/tgsi/tgsi_dump.c
src/gallium/auxiliary/tgsi/tgsi_text.c

index 36f0cc57946c37aba70d456c846db4c02f010615..f232f3870d1e8f86a1aa9b2b395b5911baf687c1 100644 (file)
@@ -352,7 +352,7 @@ iter_declaration(
       TXT(", ");
       ENM(decl->Image.Resource, tgsi_texture_names);
       TXT(", ");
-      UID(decl->Image.Format);
+      TXT(util_format_name(decl->Image.Format));
       if (decl->Image.Writable)
          TXT(", WR");
       if (decl->Image.Raw)
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);