[Mesa-dev] [PATCH 3/4] radv: check for upload alloc failure

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Mar 5 22:05:42 UTC 2017


On Sun, Mar 5, 2017 at 10:04 PM, Grazvydas Ignotas <notasas at gmail.com> wrote:
> Mainly to avoid gcc's complains about uninitialized ptr and offset use
> later in that code.
>
> Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
> ---
>  src/amd/vulkan/radv_cmd_buffer.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
> index 709ae8b..ea817b0 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -1240,9 +1240,10 @@ radv_flush_constants(struct radv_cmd_buffer *cmd_buffer,
>         if (!stages || !layout || (!layout->push_constant_size && !layout->dynamic_offset_count))
>                 return;
>
> -       radv_cmd_buffer_upload_alloc(cmd_buffer, layout->push_constant_size +
> -                                    16 * layout->dynamic_offset_count,
> -                                    256, &offset, &ptr);
> +       if (!radv_cmd_buffer_upload_alloc(cmd_buffer, layout->push_constant_size +
> +                                         16 * layout->dynamic_offset_count,
> +                                         256, &offset, &ptr))
> +               return;

We need to set cmd_buffer->record_fail on failure too. With that
fixed, this series is

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

>
>         memcpy(ptr, cmd_buffer->push_constants, layout->push_constant_size);
>         memcpy((char*)ptr + layout->push_constant_size, cmd_buffer->dynamic_buffers,
> --
> 2.7.4
>
> _______________________________________________
> 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