[Mesa-dev] [PATCH] radeonsi: fix a crash when unbinding sampler states
Dieter Nützel
Dieter at nuetzel-hh.de
Mon Apr 8 22:01:08 UTC 2019
SOLVED it.
Thanks to both of you!
Dieter
Am 08.04.2019 21:12, schrieb James Zhu:
> This patch is Acked-by: James Zhu <James.Zhu at amd.com>
>
> On 2019-04-08 3:02 p.m., Marek Olšák wrote:
>
>> On Mon, Apr 8, 2019 at 2:45 PM James Zhu <jamesz at amd.com> wrote:
>>
>> On 2019-04-08 2:39 p.m., Marek Olšák wrote:
>>
>> On Mon, Apr 8, 2019 at 2:33 PM James Zhu <jamesz at amd.com> wrote:
>>
>> On 2019-04-08 2:25 p.m., Marek Olšák wrote:
>>> From: Marek Olšák <marek.olsak at amd.com>
>>>
>>> ---
>>> src/gallium/drivers/radeonsi/si_descriptors.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c
>> b/src/gallium/drivers/radeonsi/si_descriptors.c
>>> index 244ba5a7bec..ac40ed27f91 100644
>>> --- a/src/gallium/drivers/radeonsi/si_descriptors.c
>>> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c
>>> @@ -942,21 +942,21 @@ void si_update_ps_colorbuf0_slot(struct
>> si_context *sctx)
>>> static void si_bind_sampler_states(struct pipe_context *ctx,
>>> enum pipe_shader_type shader,
>>> unsigned start, unsigned
>> count, void **states)
>>> {
>>> struct si_context *sctx = (struct si_context *)ctx;
>>> struct si_samplers *samplers = &sctx->samplers[shader];
>>> struct si_descriptors *desc =
>> si_sampler_and_image_descriptors(sctx, shader);
>>> struct si_sampler_state **sstates = (struct
>> si_sampler_state**)states;
>>> int i;
>>>
>>> - if (!count || shader >= SI_NUM_SHADERS)
>>> + if (!count || shader >= SI_NUM_SHADERS || !sstates)
>>
>> if sstates == NULL, it means we want to unbind
>> samplers->sampler_states
>> from current setting.
>>
>> So I think it is better not just bypass it.
>>
>> The driver never unbinds constant state objects. If sstates[i] ==
>> NULL, it's not unbound. sstates == NULL is a similar case.
>
> Then we should not call unbind sampler state after compute shader
> launch. Since it is doing nothing.
> You are right.
>
> Marek
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list