[Mesa-dev] [PATCH] gallium/drivers/radeonsi: Add si_bind_sampler_states unbind support

Zhu, James James.Zhu at amd.com
Sat Apr 6 13:07:35 UTC 2019


commit a613607dc3dab2b43884a4e5891aa5939cdcfbe0 will cause segfault
during unbind sampler state. This patch will fix the issue.

Signed-off-by: James Zhu <James.Zhu at amd.com>
---
 src/gallium/drivers/radeonsi/si_descriptors.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 244ba5a..883b91c 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -956,8 +956,11 @@ static void si_bind_sampler_states(struct pipe_context *ctx,
 		unsigned slot = start + i;
 		unsigned desc_slot = si_get_sampler_slot(slot);
 
-		if (!sstates[i] ||
-		    sstates[i] == samplers->sampler_states[slot])
+		if(!sstates) {
+			samplers->sampler_states[slot] = NULL;
+			continue;
+		} else if (!sstates[i] ||
+			sstates[i] == samplers->sampler_states[slot])
 			continue;
 
 #ifdef DEBUG
-- 
2.7.4



More information about the mesa-dev mailing list