[Mesa-dev] [PATCH] radeonsi: do not assert when reserving bindless slot 0

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Aug 23 16:04:56 UTC 2017



On 08/23/2017 05:59 PM, Nicolai Hähnle wrote:
> On 23.08.2017 10:10, Samuel Pitoiset wrote:
>> Both solutions look good to me.
>>
>> On 08/23/2017 10:06 AM, Michael Schellenberger Costa wrote:
>>> Hi Samuel,
>>>
>>> do you want to fully remove the assert or should this be something 
>>> the kind of
>>>
>>> MAYBE_UNUSED unsigned res = 
>>> util_idalloc_alloc(&sctx->bindless_used_slots);
>>> assert(res != 0);
> 
> I think you got the sense of the assertion wrong :)

Yeah... But after :)

I pushed a fix for that, sorry.

> 
> Cheers,
> Nicolai
> 
>>>
>>> --Michael
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] Im 
>>> Auftrag von Samuel Pitoiset
>>> Gesendet: Mittwoch, 23. August 2017 09:43
>>> An: mesa-dev at lists.freedesktop.org
>>> Betreff: [Mesa-dev] [PATCH] radeonsi: do not assert when reserving 
>>> bindless slot 0
>>>
>>> When assertions were disabled, the compiler removed
>>> the call to util_idalloc_alloc() and the first allocated
>>> bindless slot was 0 which is invalid per the spec.
>>>
>>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.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 f66ecc3e68..c53253ac8d 100644
>>> --- a/src/gallium/drivers/radeonsi/si_descriptors.c
>>> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c
>>> @@ -2192,7 +2192,7 @@ static void si_init_bindless_descriptors(struct 
>>> si_context *sctx,
>>>       util_idalloc_resize(&sctx->bindless_used_slots, num_elements);
>>>       /* Reserve slot 0 because it's an invalid handle for bindless. */
>>> -    assert(!util_idalloc_alloc(&sctx->bindless_used_slots));
>>> +    util_idalloc_alloc(&sctx->bindless_used_slots);
>>>   }
>>>   static void si_release_bindless_descriptors(struct si_context *sctx)
>>>
>> _______________________________________________
>> 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