util: Fix translate from block compressed to rgba

Since
2b5178ee util: Switch the non-block formats to unpacking rgba rows instead of rects,
compressed formats define unpack_rgba_8unorm_rect instead
of unpack_rgba_8unorm.

Fixes the u_format_translate check to take this into account.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5201
Fixes: 2b5178ee ("util: Switch the non-block formats to unpacking rgba rows instead of rects")

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12315>
(cherry picked from commit 6a0e703512)
This commit is contained in:
Axel Davy 2021-08-10 20:52:45 +02:00 committed by Dylan Baker
parent 449df77f5e
commit f7e77b7708
2 changed files with 4 additions and 4 deletions

View file

@ -157,7 +157,7 @@
"description": "util: Fix translate from block compressed to rgba",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "2b5178ee4820d69386dfa0ecb28fe9fe7c4f0964"
},

View file

@ -740,7 +740,7 @@ util_format_translate(enum pipe_format dst_format,
unsigned tmp_stride;
uint8_t *tmp_row;
if (!unpack->unpack_rgba_8unorm ||
if ((!unpack->unpack_rgba_8unorm && !unpack->unpack_rgba_8unorm_rect) ||
!pack->pack_rgba_8unorm) {
return FALSE;
}
@ -802,7 +802,7 @@ util_format_translate(enum pipe_format dst_format,
unsigned tmp_stride;
unsigned int *tmp_row;
if (!unpack->unpack_rgba ||
if ((!unpack->unpack_rgba && !unpack->unpack_rgba_rect) ||
!pack->pack_rgba_uint) {
return FALSE;
}
@ -832,7 +832,7 @@ util_format_translate(enum pipe_format dst_format,
unsigned tmp_stride;
float *tmp_row;
if (!unpack->unpack_rgba ||
if ((!unpack->unpack_rgba && !unpack->unpack_rgba_rect) ||
!pack->pack_rgba_float) {
return FALSE;
}