Mesa (main): freedreno: Handle cso==NULL in bind_sampler_states

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 4 15:29:13 UTC 2021


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Mon Aug 23 17:18:57 2021 -0700

freedreno: Handle cso==NULL in bind_sampler_states

This is a thing that comes up with clover.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>

---

 src/gallium/drivers/freedreno/freedreno_texture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c
index 9aa9cddce61..0c2edd2f858 100644
--- a/src/gallium/drivers/freedreno/freedreno_texture.c
+++ b/src/gallium/drivers/freedreno/freedreno_texture.c
@@ -56,7 +56,7 @@ bind_sampler_states(struct fd_texture_stateobj *tex, unsigned start,
 
    for (i = 0; i < nr; i++) {
       unsigned p = i + start;
-      tex->samplers[p] = hwcso[i];
+      tex->samplers[p] = hwcso ? hwcso[i] : NULL;
       if (tex->samplers[p])
          tex->valid_samplers |= (1 << p);
       else



More information about the mesa-commit mailing list