summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_batch_chain.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2017-03-06 12:28:44 +0100
committerIago Toral Quiroga <[email protected]>2017-03-16 11:40:05 +0100
commitdd8348c8be013c40bf1f1838be2dfa5e654bc372 (patch)
treec9b55cb684214fef6477a52ca2250a85348922bd /src/intel/vulkan/anv_batch_chain.c
parentbe52f9693acb6055f62548e838348c584bbd08d7 (diff)
anv: handle errors while allocating new binding table blocks
Also, we had a couple of instances in flush_descriptor_sets() were we were returning a VkResult directly upon error, but the return value of this function is not a VkResult but a uint32_t dirty mask, so simply return 0 in these cases which reduces the amount of work the driver will do after the error has been raised. Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_batch_chain.c')
-rw-r--r--src/intel/vulkan/anv_batch_chain.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 655182db260..5d7abc68b32 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -665,8 +665,10 @@ anv_cmd_buffer_new_binding_table_block(struct anv_cmd_buffer *cmd_buffer)
&cmd_buffer->device->surface_state_block_pool;
int32_t *offset = u_vector_add(&cmd_buffer->bt_blocks);
- if (offset == NULL)
+ if (offset == NULL) {
+ anv_batch_set_error(&cmd_buffer->batch, VK_ERROR_OUT_OF_HOST_MEMORY);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+ }
*offset = anv_block_pool_alloc_back(block_pool);
cmd_buffer->bt_next = 0;
@@ -719,7 +721,9 @@ anv_cmd_buffer_init_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer)
goto fail_bt_blocks;
cmd_buffer->last_ss_pool_center = 0;
- anv_cmd_buffer_new_binding_table_block(cmd_buffer);
+ result = anv_cmd_buffer_new_binding_table_block(cmd_buffer);
+ if (result != VK_SUCCESS)
+ goto fail_bt_blocks;
return VK_SUCCESS;