aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/encoder/pan_texture.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-15 18:43:41 -0400
committerMarge Bot <[email protected]>2020-05-19 18:09:26 +0000
commit861e7dcae6b1156f9eca5ad28b6e21a1e62358da (patch)
tree4a2723702f2114235f425ec5a87333ac23f59f9a /src/panfrost/encoder/pan_texture.c
parent6be9e094737aa9bf221724f14228bf2f1286bb2f (diff)
panfrost: Switch formats to table
Rather than heuristically guessing what PIPE formats correspond to what in the hardware, hardcode a table. This is more verbose, but a lot more obvious -- the previous format support code was a source of endless silent bugs. v2: Don't report RGB233 (icecream95). Allow RGB5 for texturing (icecream95). Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5069>
Diffstat (limited to 'src/panfrost/encoder/pan_texture.c')
-rw-r--r--src/panfrost/encoder/pan_texture.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/panfrost/encoder/pan_texture.c b/src/panfrost/encoder/pan_texture.c
index 3f5d26680a7..9fb134e48ed 100644
--- a/src/panfrost/encoder/pan_texture.c
+++ b/src/panfrost/encoder/pan_texture.c
@@ -252,7 +252,8 @@ panfrost_new_texture(
unsigned bytes_per_pixel = util_format_get_blocksize(format);
- enum mali_format mali_format = panfrost_find_format(desc);
+ enum mali_format mali_format = panfrost_pipe_format_table[desc->format].hw;
+ assert(mali_format);
bool manual_stride = (layout == MALI_TEXTURE_LINEAR)
&& panfrost_needs_explicit_stride(slices, width,
@@ -313,7 +314,8 @@ panfrost_new_texture_bifrost(
const struct util_format_description *desc =
util_format_description(format);
- enum mali_format mali_format = panfrost_find_format(desc);
+ enum mali_format mali_format = panfrost_pipe_format_table[desc->format].hw;
+ assert(mali_format);
panfrost_emit_texture_payload(
(mali_ptr *) payload->cpu,