panfrost: Identify texture layout field

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4680>
This commit is contained in:
Alyssa Rosenzweig 2020-04-21 16:20:55 -04:00 committed by Tomeu Vizoso
parent ad4024968e
commit 36d49b1fb1
3 changed files with 6 additions and 9 deletions

View file

@ -271,7 +271,7 @@ panfrost_new_texture_bifrost(
descriptor->width = MALI_POSITIVE(u_minify(width, first_level)); descriptor->width = MALI_POSITIVE(u_minify(width, first_level));
descriptor->height = MALI_POSITIVE(u_minify(height, first_level)); descriptor->height = MALI_POSITIVE(u_minify(height, first_level));
descriptor->swizzle = swizzle; descriptor->swizzle = swizzle;
descriptor->unk0 = 0x1; descriptor->layout = layout;
descriptor->levels = last_level - first_level; descriptor->levels = last_level - first_level;
descriptor->unk1 = 0x0; descriptor->unk1 = 0x0;
descriptor->levels_unk = 0; descriptor->levels_unk = 0;

View file

@ -1255,7 +1255,7 @@ struct bifrost_texture_descriptor {
/* OpenGL swizzle */ /* OpenGL swizzle */
unsigned swizzle : 12; unsigned swizzle : 12;
unsigned unk0 : 4; /* 1 */ enum mali_texture_layout layout : 4;
uint8_t levels : 8; /* Number of levels-1 if mipmapped, 0 if not */ uint8_t levels : 8; /* Number of levels-1 if mipmapped, 0 if not */
unsigned unk1 : 4; unsigned unk1 : 4;

View file

@ -2161,7 +2161,6 @@ pandecode_bifrost_texture(const struct bifrost_texture_descriptor *t, unsigned j
pandecode_prop("width = %" PRId32, t->width); pandecode_prop("width = %" PRId32, t->width);
pandecode_prop("height = %" PRId32, t->height); pandecode_prop("height = %" PRId32, t->height);
pandecode_prop("swizzle = 0x%" PRIx32, t->swizzle); pandecode_prop("swizzle = 0x%" PRIx32, t->swizzle);
pandecode_prop("unk0 = 0x%" PRIx32, t->unk0);
pandecode_prop("levels = %" PRId32, t->levels); pandecode_prop("levels = %" PRId32, t->levels);
pandecode_prop("unk1 = 0x%" PRIx32, t->unk1); pandecode_prop("unk1 = 0x%" PRIx32, t->unk1);
pandecode_prop("levels_unk = %" PRId32, t->levels_unk); pandecode_prop("levels_unk = %" PRId32, t->levels_unk);
@ -2178,19 +2177,17 @@ pandecode_bifrost_texture(const struct bifrost_texture_descriptor *t, unsigned j
bool is_cube = t->type == MALI_TEX_CUBE; bool is_cube = t->type == MALI_TEX_CUBE;
unsigned dimension = is_cube ? 2 : t->type; unsigned dimension = is_cube ? 2 : t->type;
#if 0
/* Print the layout. Default is linear; a modifier can denote AFBC or /* Print the layout. Default is linear; a modifier can denote AFBC or
* u-interleaved/tiled modes */ * u-interleaved/tiled modes */
if (f.layout == MALI_TEXTURE_AFBC) if (t->layout == MALI_TEXTURE_AFBC)
pandecode_log_cont("afbc"); pandecode_log_cont("afbc");
else if (f.layout == MALI_TEXTURE_TILED) else if (t->layout == MALI_TEXTURE_TILED)
pandecode_log_cont("tiled"); pandecode_log_cont("tiled");
else if (f.layout == MALI_TEXTURE_LINEAR) else if (t->layout == MALI_TEXTURE_LINEAR)
pandecode_log_cont("linear"); pandecode_log_cont("linear");
else else
pandecode_msg("XXX: invalid texture layout 0x%X\n", f.layout); pandecode_msg("XXX: invalid texture layout 0x%X\n", t->layout);
#endif
pandecode_swizzle(t->swizzle, t->format); pandecode_swizzle(t->swizzle, t->format);
pandecode_log_cont(" "); pandecode_log_cont(" ");