cso: Revert using FS sampler count for other stages at context unbind.
authorEmma Anholt <emma@anholt.net>
Fri, 3 Sep 2021 00:13:52 +0000 (17:13 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 6 Sep 2021 18:09:25 +0000 (18:09 +0000)
You shouldn't be asking drivers without VS texturing to unbind VS
textures, which was breaking i915g.

Fixes: 802e43a6b587 ("gallium/cso: add unbind mask for cso restore")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12218>

src/gallium/auxiliary/cso_cache/cso_context.c

index 9793131..97b4da0 100644 (file)
@@ -325,7 +325,8 @@ void cso_unbind_context(struct cso_context *ctx)
                break;
             }
 
-            int maxsam = ctx->max_fs_samplerviews;
+            int maxsam = scr->get_shader_param(scr, sh,
+                                               PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
             int maxview = scr->get_shader_param(scr, sh,
                                                 PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS);
             int maxssbo = scr->get_shader_param(scr, sh,