pvr: fix mipmap alignment for non-32bpp textures

There is no alignment necessary between mip levels.

Fixes test cases:
  dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_non_square_fastest
  dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_non_square_nicest
  dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_non_square_fastest
  dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_non_square_nicest
  dEQP-GLES3.functional.texture.mipmap.2d.generate.a8_non_square_fastest
  dEQP-GLES3.functional.texture.mipmap.2d.generate.a8_non_square_nicest
  dEQP-GLES3.functional.texture.mipmap.2d.generate.l8_non_square_fastest
  dEQP-GLES3.functional.texture.mipmap.2d.generate.l8_non_square_nicest

Fixes: 8991e64641 ("pvr: Add a Vulkan driver for Imagination Technologies...")
Signed-off-by: Iliyan Dinev <iliyan.dinev@imgtec.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31679>
This commit is contained in:
Iliyan Dinev 2024-06-28 08:38:51 +01:00 committed by Marge Bot
parent fa889ffec7
commit 1d0f23752c

View file

@ -88,11 +88,6 @@ static void pvr_image_setup_mip_levels(struct pvr_image *image)
VkExtent3D extent =
vk_image_extent_to_elements(&image->vk, image->physical_extent);
/* Mip-mapped textures that are non-dword aligned need dword-aligned levels
* so they can be TQd from.
*/
const uint32_t level_alignment = image->vk.mip_levels > 1 ? 4 : 1;
assert(image->vk.mip_levels <= ARRAY_SIZE(image->mip_levels));
image->layer_size = 0;
@ -105,7 +100,6 @@ static void pvr_image_setup_mip_levels(struct pvr_image *image)
mip_level->size = image->vk.samples * mip_level->pitch *
mip_level->height_pitch *
ALIGN(extent.depth, extent_alignment);
mip_level->size = ALIGN(mip_level->size, level_alignment);
mip_level->offset = image->layer_size;
image->layer_size += mip_level->size;