Module: Mesa
Branch: staging/22.3
Commit: a7669a78884f93c88c69912d69e676553a8ef234
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7669a78884f93c88c69912d69e676553a8ef234

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>
(cherry picked from commit aff5fe3f9437ad9339d33d150eefc367875e2329)

---

 .pick_status.json           | 2 +-
 src/amd/vulkan/radv_image.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index da284540258..3546d9b9eba 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1111,7 +1111,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"
     },
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 4c6224769da..4f8e06bd358 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -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) {

Reply via email to