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

Marek Olšák maraeo at gmail.com
Mon Apr 8 18:28:45 UTC 2019


I've sent a simpler patch. Please review.

Thanks,
Marek

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

> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190408/37c545f6/attachment.html>


More information about the mesa-dev mailing list