<div dir="ltr"><div>I've sent a simpler patch. Please review.</div><div><br></div><div>Thanks,</div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 6, 2019 at 9:07 AM Zhu, James <<a href="mailto:James.Zhu@amd.com">James.Zhu@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">commit a613607dc3dab2b43884a4e5891aa5939cdcfbe0 will cause segfault<br>
during unbind sampler state. This patch will fix the issue.<br>
<br>
Signed-off-by: James Zhu <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>><br>
---<br>
src/gallium/drivers/radeonsi/si_descriptors.c | 7 +++++--<br>
1 file changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c<br>
index 244ba5a..883b91c 100644<br>
--- a/src/gallium/drivers/radeonsi/si_descriptors.c<br>
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c<br>
@@ -956,8 +956,11 @@ static void si_bind_sampler_states(struct pipe_context *ctx,<br>
unsigned slot = start + i;<br>
unsigned desc_slot = si_get_sampler_slot(slot);<br>
<br>
- if (!sstates[i] ||<br>
- sstates[i] == samplers->sampler_states[slot])<br>
+ if(!sstates) {<br>
+ samplers->sampler_states[slot] = NULL;<br>
+ continue;<br>
+ } else if (!sstates[i] ||<br>
+ sstates[i] == samplers->sampler_states[slot])<br>
continue;<br>
<br>
#ifdef DEBUG<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>