[Mesa-dev] [PATCH v2] i965: do not emit empty surface state

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Aug 14 22:11:29 UTC 2018


Hey Erik,

Out of curiosity, what app/test managed to run into this assert?
We could have some test added :)

Thanks,

-
Lionel

On 08/08/18 09:34, Lionel Landwerlin wrote:
> On 07/08/18 20:31, Erik Faye-Lund wrote:
>> If called with an empty size, brw_emit_buffer_surface_state asserts.
>> We already have a dedicated helper for uploading nothing, so let's use
>> that instead.
>>
>> Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
>
> Looks good to me. Maybe Ken can confirm?
>
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>
>> ---
>>
>> Here's an updated patch.
>>
>> v2: call emit_null_surface_state to ensure out_offset is initialized
>>      properly. (Lionel)
>>
>>   src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c 
>> b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
>> index 9397b637c7..2aef0ef59f 100644
>> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
>> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
>> @@ -1322,6 +1322,11 @@ upload_buffer_surface(struct brw_context *brw,
>>         if (!binding->AutomaticSize)
>>            size = MIN2(size, binding->Size);
>>   +      if (size == 0) {
>> +         emit_null_surface_state(brw, NULL, out_offset);
>> +         return;
>> +      }
>> +
>>         struct intel_buffer_object *iobj =
>>            intel_buffer_object(binding->BufferObject);
>>         struct brw_bo *bo =
>
>
> _______________________________________________
> 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