I've sent a simpler patch. Please review.

Thanks,
Marek

On Sat, Apr 6, 2019 at 9:07 AM Zhu, James <james....@amd.com> wrote:

> commit a613607dc3dab2b43884a4e5891aa5939cdcfbe0 will cause segfault
> during unbind sampler state. This patch will fix the issue.
>
> Signed-off-by: James Zhu <james....@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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to