[Mesa-dev] [PATCH 2/4] anv/cmd_buffer: Handle running out of binding tables in compute shaders

Jason Ekstrand jason at jlekstrand.net
Tue Nov 22 16:09:51 UTC 2016


On Tue, Nov 22, 2016 at 2:08 AM, Lionel Landwerlin <
lionel.g.landwerlin at intel.com> wrote:

> On 22/11/16 04:26, Jason Ekstrand wrote:
>
>> If we try to allocate a binding table and fail, we have to get a new
>> binding table block, re-emit STATE_BASE_ADDRESS, and then try again.  We
>> already handle this correctly for 3D and blorp but it never got handled
>> for
>> CS.  This fixes the new stress.lots-of-surface-state.cs.static crucible
>> test.
>>
>> Cc: "13.0" <mesa-stable at lists.freedesktop.org>
>> Cc: Jordan Justen <jordan.l.justen at intel.com>
>> ---
>>   src/intel/vulkan/genX_cmd_buffer.c | 20 +++++++++++++++-----
>>   1 file changed, 15 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/intel/vulkan/genX_cmd_buffer.c
>> b/src/intel/vulkan/genX_cmd_buffer.c
>> index de3253f..6645d1b 100644
>> --- a/src/intel/vulkan/genX_cmd_buffer.c
>> +++ b/src/intel/vulkan/genX_cmd_buffer.c
>> @@ -1674,12 +1674,22 @@ flush_compute_descriptor_set(struct
>> anv_cmd_buffer *cmd_buffer)
>>      struct anv_state surfaces = { 0, }, samplers = { 0, };
>>      VkResult result;
>>   -   result = emit_samplers(cmd_buffer, MESA_SHADER_COMPUTE, &samplers);
>> -   if (result != VK_SUCCESS)
>> -      return result;
>>      result = emit_binding_table(cmd_buffer, MESA_SHADER_COMPUTE,
>> &surfaces);
>> -   if (result != VK_SUCCESS)
>> -      return result;
>> +   if (result != VK_SUCCESS) {
>>
>
> Would it make sense to have the same assert(result ==
> VK_ERROR_OUT_OF_DEVICE_MEMORY); here?
> Anyhow,
>

Yes, but I forgot to make the change before pushing. :(  I'll push another
patch.


> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>

Thanks!


>
> +      result = anv_cmd_buffer_new_binding_table_block(cmd_buffer);
>> +      assert(result == VK_SUCCESS);
>> +
>> +      /* Re-emit state base addresses so we get the new surface state
>> base
>> +       * address before we start emitting binding tables etc.
>> +       */
>> +      genX(cmd_buffer_emit_state_base_address)(cmd_buffer);
>> +
>> +      result = emit_binding_table(cmd_buffer, MESA_SHADER_COMPUTE,
>> &surfaces);
>> +      assert(result == VK_SUCCESS);
>> +   }
>> +   result = emit_samplers(cmd_buffer, MESA_SHADER_COMPUTE, &samplers);
>> +   assert(result == VK_SUCCESS);
>> +
>>        struct anv_state push_state = anv_cmd_buffer_cs_push_constan
>> ts(cmd_buffer);
>>
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161122/c7847c55/attachment.html>


More information about the mesa-dev mailing list