diff options
author | Ilia Mirkin <[email protected]> | 2016-01-09 01:04:08 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-02-15 22:22:33 -0500 |
commit | e2a1ec5f0f0314915fdfc9a8ef93f3789f356404 (patch) | |
tree | a1c81bcf25c0a3474a872788c0943bf84752001a /src/gallium | |
parent | 9fbfa1abb2f88a534139738ee7cf022217342652 (diff) |
tgsi: show textual format representation
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_dump.c | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_text.c | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index 36f0cc57946..f232f3870d1 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -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) diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index ef43ebc6619..91baa01ad8b 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -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); |