diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-20 15:24:45 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-21 08:40:55 -0700 |
commit | 9b203950ec6480d38925a0b81e0066766268b126 (patch) | |
tree | eca89284b5e2de526e9488329a6c6a6360bd3e24 /src | |
parent | 47af32b15ed356b227a071a2e8943f20e4253bbd (diff) |
pan/decode: Pretty-print sRGB format
We can just stick an "s" in if it's sRGB.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/pandecode/decode.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index 4ebab6d466f..f14cc805406 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -807,7 +807,7 @@ pandecode_validate_format_swizzle(enum mali_format fmt, unsigned swizzle) /* Maps MALI_RGBA32F to rgba32f, etc */ static void -pandecode_format_short(enum mali_format fmt) +pandecode_format_short(enum mali_format fmt, bool srgb) { /* We want a type-like format, so cut off the initial MALI_ */ char *format = pandecode_format(fmt); @@ -819,6 +819,14 @@ pandecode_format_short(enum mali_format fmt) for (unsigned i = 0; i < len; ++i) lower_format[i] = tolower(format[i]); + /* Sanity check sRGB flag is applied to RGB, per the name */ + if (srgb && lower_format[0] != 'r') + pandecode_msg("XXX: sRGB applied to non-colour format\n"); + + /* Just prefix with an s, so you get formats like srgba8_unorm */ + if (srgb) + pandecode_log_cont("s"); + pandecode_log_cont("%s", lower_format); free(lower_format); } @@ -1525,7 +1533,7 @@ pandecode_attribute_meta(int job_no, int count, const struct mali_vertex_tiler_p } pandecode_make_indent(); - pandecode_format_short(attr_meta->format); + pandecode_format_short(attr_meta->format, false); pandecode_log_cont(" %s_%u", prefix, attr_meta->index); if (attr_meta->src_offset) @@ -1799,12 +1807,11 @@ pandecode_texture(mali_ptr u, pandecode_indent++; pandecode_log(".format = "); - pandecode_format_short(f.format); + pandecode_format_short(f.format, f.srgb); pandecode_swizzle(f.swizzle, f.format); pandecode_log_cont(",\n"); pandecode_prop("type = %s", pandecode_texture_type(f.type)); - pandecode_prop("srgb = %" PRId32, f.srgb); pandecode_prop("usage2 = 0x%" PRIx32, f.usage2); if (f.unknown1) { |