radv: fix setting MAX_MIP for BC views

MAX_MIP should always be the number of levels minus one from the hw
perspective.

This doesn't fix anything known.

Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
(cherry picked from commit aff5fe3f94)
This commit is contained in:
Samuel Pitoiset 2023-01-17 17:33:12 +01:00 committed by Eric Engestrom
parent c70ffcc8e3
commit 2414591e5c
2 changed files with 2 additions and 2 deletions

View file

@ -2911,7 +2911,7 @@
"description": "radv: fix setting MAX_MIP for BC views",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "98ba1e0d817e0354aad5d82eb9a2dc4cce33540f"
},

View file

@ -1042,7 +1042,7 @@ gfx10_make_texture_descriptor(struct radv_device *device, struct radv_image *ima
unsigned max_mip =
image->info.samples > 1 ? util_logbase2(image->info.samples) : image->info.levels - 1;
if (nbc_view && nbc_view->valid)
max_mip = nbc_view->max_mip;
max_mip = nbc_view->max_mip - 1;
unsigned min_lod_clamped = radv_float_to_ufixed(CLAMP(min_lod, 0, 15), 8);
if (device->physical_device->rad_info.gfx_level >= GFX11) {