Mesa (main): lavapipe: do not assert on more than 32 samplers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 28 08:48:31 UTC 2021


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

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>

---

 src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c | 3 +++
 1 file changed, 3 insertions(+)

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