panfrost: Identify Bifrost texture format swizzle

We don't force w=1 for Bifrost textures. We already compose this into
the swizzle as necessary, so we can just ignore this field I think. But
let's identify it so we don't forget what it is.

The blob uses it to force w=1 for <= 3-channel formats (0x10), as well
as a flag to swap r/b for BGRA (0x4). There are probably other flags
here but it doesn't.. really matter to us.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5232>
This commit is contained in:
Alyssa Rosenzweig
2020-05-26 19:48:29 -04:00
parent e3692fd53e
commit d45936c01c
3 changed files with 9 additions and 3 deletions

View File

@@ -333,7 +333,6 @@ panfrost_new_texture_bifrost(
descriptor->format_unk = 0x2; descriptor->format_unk = 0x2;
descriptor->type = type; descriptor->type = type;
descriptor->format_unk2 = 0x100;
descriptor->format = mali_format; descriptor->format = mali_format;
descriptor->srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB); descriptor->srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
descriptor->format_unk3 = 0x0; descriptor->format_unk3 = 0x0;

View File

@@ -1253,7 +1253,8 @@ struct mali_texture_descriptor {
struct bifrost_texture_descriptor { struct bifrost_texture_descriptor {
unsigned format_unk : 4; /* 2 */ unsigned format_unk : 4; /* 2 */
enum mali_texture_type type : 2; enum mali_texture_type type : 2;
unsigned format_unk2 : 16; /* 0 */ unsigned zero : 4;
unsigned format_swizzle : 12;
enum mali_format format : 8; enum mali_format format : 8;
unsigned srgb : 1; unsigned srgb : 1;
unsigned format_unk3 : 1; /* 0 */ unsigned format_unk3 : 1; /* 0 */

View File

@@ -2210,7 +2210,13 @@ pandecode_bifrost_texture(
pandecode_prop("format_unk = 0x%" PRIx32, t->format_unk); pandecode_prop("format_unk = 0x%" PRIx32, t->format_unk);
pandecode_prop("type = %" PRId32, t->type); pandecode_prop("type = %" PRId32, t->type);
pandecode_prop("format_unk2 = 0x%" PRIx32, t->format_unk2);
if (t->zero) {
pandecode_msg("XXX: zero tripped\n");
pandecode_prop("zero = 0x%" PRIx32, t->zero);
}
pandecode_prop("format_swizzle = 0x%" PRIx32, t->format_swizzle);
pandecode_prop("format = 0x%" PRIx32, t->format); pandecode_prop("format = 0x%" PRIx32, t->format);
pandecode_prop("srgb = 0x%" PRIx32, t->srgb); pandecode_prop("srgb = 0x%" PRIx32, t->srgb);
pandecode_prop("format_unk3 = 0x%" PRIx32, t->format_unk3); pandecode_prop("format_unk3 = 0x%" PRIx32, t->format_unk3);