Module: Mesa
Branch: main
Commit: aff5fe3f9437ad9339d33d150eefc367875e2329
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aff5fe3f9437ad9339d33d150eefc367875e2329

Author: Samuel Pitoiset <[email protected]>
Date:   Tue Jan 17 17:33:12 2023 +0100

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: 98ba1e0d817 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>

---

 src/amd/vulkan/radv_image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 93cde535292..a1238f7335f 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -1048,7 +1048,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) {

Reply via email to