Mesa (staging/21.2): lavapipe: do not assert on more than 32 samplers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 28 23:00:07 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 6705d498f49c3d7326bc8bb4742b05f308764853
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6705d498f49c3d7326bc8bb4742b05f308764853

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Jul 13 11:26:01 2021 +0200

lavapipe: do not assert on more than 32 samplers

We can have more than 32 samplers, but the code below will assert in that
case. The return value is not used for samplers, so let's just return
zero early and be done with it.

Fixes: c18ff60087e ("lavapipe: emit correct textures_used for texture-arrays")
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11845>
(cherry picked from commit bff8a948f70af672b2a9311e3ae262928648f818)

---

 .pick_status.json                                          | 2 +-
 src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index ab39cd52bda..f89a1a8fd14 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -256,7 +256,7 @@
         "description": "lavapipe: do not assert on more than 32 samplers",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "c18ff60087ef655b9a584c4586859df5e2bf7d28"
     },
diff --git a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c
index ca38e308bf5..b77199e931c 100644
--- a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c
+++ b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c
@@ -144,6 +144,9 @@ lower_vri_instr_tex_deref(nir_tex_instr *tex,
    else
       tex->texture_index = value;
 
+   if (deref_src_type == nir_tex_src_sampler_deref)
+      return 0;
+
    if (deref_instr->deref_type == nir_deref_type_array) {
       assert(glsl_type_is_array(var->type));
       assert(value >= 0);



More information about the mesa-commit mailing list