<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 8, 2019 at 2:33 PM James Zhu <<a href="mailto:jamesz@amd.com">jamesz@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"><br>
On 2019-04-08 2:25 p.m., Marek Olšák wrote:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
><br>
> ---<br>
> src/gallium/drivers/radeonsi/si_descriptors.c | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c<br>
> index 244ba5a7bec..ac40ed27f91 100644<br>
> --- a/src/gallium/drivers/radeonsi/si_descriptors.c<br>
> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c<br>
> @@ -942,21 +942,21 @@ void si_update_ps_colorbuf0_slot(struct si_context *sctx)<br>
> static void si_bind_sampler_states(struct pipe_context *ctx,<br>
> enum pipe_shader_type shader,<br>
> unsigned start, unsigned count, void **states)<br>
> {<br>
> struct si_context *sctx = (struct si_context *)ctx;<br>
> struct si_samplers *samplers = &sctx->samplers[shader];<br>
> struct si_descriptors *desc = si_sampler_and_image_descriptors(sctx, shader);<br>
> struct si_sampler_state **sstates = (struct si_sampler_state**)states;<br>
> int i;<br>
> <br>
> - if (!count || shader >= SI_NUM_SHADERS)<br>
> + if (!count || shader >= SI_NUM_SHADERS || !sstates)<br>
<br>
if sstates == NULL, it means we want to unbind samplers->sampler_states <br>
from current setting.<br>
<br>
So I think it is better not just bypass it.<br></blockquote><div><br></div>The driver never unbinds constant state objects. If sstates[i] == NULL, it's not unbound. sstates == NULL is a similar case.</div><div class="gmail_quote"><br></div><div class="gmail_quote">It's not a standard behavior, but the driver has been doing it for a very long time.<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Marek<br></div></div>