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

Dieter Nützel Dieter at nuetzel-hh.de
Sun Apr 7 02:06:45 UTC 2019


Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>

Thank you James!

Dieter

Am 06.04.2019 15:07, schrieb Zhu, James:
> 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


More information about the mesa-dev mailing list