ac/surface: only adjust pitch if surf_pitch was modified
authorYogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Tue, 28 Feb 2023 14:48:17 +0000 (20:18 +0530)
committerMarge Bot <emma+marge@anholt.net>
Tue, 7 Mar 2023 13:50:31 +0000 (13:50 +0000)
commit347a5b79f974a99874e12ad1806850295995c823
treef0a07925341934f45f78713f98f2c5e92c9e3136
parentf72774f13f40672ea985db96242f92f493f03683
ac/surface: only adjust pitch if surf_pitch was modified

Modifying pitch for all LINEAR surface isn't correct;
the original change that modified surf_pitch was only
intended for YUV textures.

This fixes vkGetImageSubresourceLayout rowPitch return value
for VK_FORMAT_BC3_UNORM_BLOCK + VK_IMAGE_TILING_LINEAR.

Fixes: fcc499d5 (ac/surface: adjust gfx9.pitch[*] based on surf->blk_w)

v2: add check for UYVY format (Pierre-Eric)
v3: move blk_w division to above if check (Pierre-Eric)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21595>
src/amd/common/ac_surface.c