diff options
author | Grazvydas Ignotas <[email protected]> | 2017-03-05 23:04:52 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-03-06 00:10:42 +0100 |
commit | a5446e3187ecaca5212e37a502c0145cc0299c47 (patch) | |
tree | fd5bfca614730b03aed9b27daf70ec2cf9b7715a | |
parent | 666fe622e1b4c04e251cef6136500f3e71a17483 (diff) |
radv: check for upload alloc failure
Mainly to avoid gcc's complains about uninitialized ptr and offset use
later in that code.
Signed-off-by: Grazvydas Ignotas <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index dec3e9fd21d..16c3f7893b9 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -1285,9 +1285,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; memcpy(ptr, cmd_buffer->push_constants, layout->push_constant_size); memcpy((char*)ptr + layout->push_constant_size, cmd_buffer->dynamic_buffers, |