[Mesa-dev] [PATCH 1/4] anv/cmd_buffer: never shrink the push constant buffer size

Lionel Landwerlin lionel.g.landwerlin at intel.com
Sun Jul 1 16:33:33 UTC 2018


I reread the discussion you had with Jason in order to figure out why 
this change is required.
Maybe adding a comment at the top of the function would be a good bit of 
documentation for future developers ;)

Regardless this series is :

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

Thanks!

On 29/06/18 09:10, Iago Toral Quiroga wrote:
> If we have to re-emit push constant data, we need to re-emit all
> of it.
> ---
>   src/intel/vulkan/anv_cmd_buffer.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c
> index 33687920a38..3e9f000f7b8 100644
> --- a/src/intel/vulkan/anv_cmd_buffer.c
> +++ b/src/intel/vulkan/anv_cmd_buffer.c
> @@ -166,6 +166,7 @@ anv_cmd_buffer_ensure_push_constants_size(struct anv_cmd_buffer *cmd_buffer,
>            anv_batch_set_error(&cmd_buffer->batch, VK_ERROR_OUT_OF_HOST_MEMORY);
>            return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
>         }
> +      (*ptr)->size = size;
>      } else if ((*ptr)->size < size) {
>         *ptr = vk_realloc(&cmd_buffer->pool->alloc, *ptr, size, 8,
>                            VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
> @@ -173,8 +174,8 @@ anv_cmd_buffer_ensure_push_constants_size(struct anv_cmd_buffer *cmd_buffer,
>            anv_batch_set_error(&cmd_buffer->batch, VK_ERROR_OUT_OF_HOST_MEMORY);
>            return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
>         }
> +      (*ptr)->size = size;
>      }
> -   (*ptr)->size = size;
>   
>      return VK_SUCCESS;
>   }




More information about the mesa-dev mailing list