anv: fix up image views for emulated formats
When the view format is the same as the image format, and the format is emulated, change the format to the decompressed format. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
This commit is contained in:
parent
a73e0e9a04
commit
7b84c8d6ea
1 changed files with 8 additions and 3 deletions
|
|
@ -3167,9 +3167,14 @@ anv_image_view_init(struct anv_device *device,
|
|||
anv_foreach_image_aspect_bit(iaspect_bit, image, iview->vk.aspects) {
|
||||
const uint32_t vplane =
|
||||
anv_aspect_to_plane(iview->vk.aspects, 1UL << iaspect_bit);
|
||||
struct anv_format_plane format;
|
||||
format = anv_get_format_plane(device->info, iview->vk.view_format,
|
||||
vplane, image->vk.tiling);
|
||||
|
||||
VkFormat view_format = iview->vk.view_format;
|
||||
if (anv_is_format_emulated(device->physical, view_format)) {
|
||||
assert(image->emu_plane_format != VK_FORMAT_UNDEFINED);
|
||||
view_format = vk_texcompress_astc_emulation_format(view_format);
|
||||
}
|
||||
const struct anv_format_plane format = anv_get_format_plane(
|
||||
device->info, view_format, vplane, image->vk.tiling);
|
||||
|
||||
iview->planes[vplane].isl = (struct isl_view) {
|
||||
.format = format.isl_format,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue