aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_cmd_buffer.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/genX_cmd_buffer.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/genX_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 4d14fcd2f73..57ebbf8e29c 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -1376,7 +1376,8 @@ flush_descriptor_sets(struct anv_cmd_buffer *cmd_buffer)
assert(result == VK_ERROR_OUT_OF_DEVICE_MEMORY);
result = anv_cmd_buffer_new_binding_table_block(cmd_buffer);
- assert(result == VK_SUCCESS);
+ if (result != VK_SUCCESS)
+ return 0;
/* Re-emit state base addresses so we get the new surface state base
* address before we start emitting binding tables etc.
@@ -1388,11 +1389,11 @@ flush_descriptor_sets(struct anv_cmd_buffer *cmd_buffer)
anv_foreach_stage(s, dirty) {
result = emit_samplers(cmd_buffer, s, &cmd_buffer->state.samplers[s]);
if (result != VK_SUCCESS)
- return result;
+ return 0;
result = emit_binding_table(cmd_buffer, s,
&cmd_buffer->state.binding_tables[s]);
if (result != VK_SUCCESS)
- return result;
+ return 0;
}
}
@@ -1847,8 +1848,10 @@ flush_compute_descriptor_set(struct anv_cmd_buffer *cmd_buffer)
result = emit_binding_table(cmd_buffer, MESA_SHADER_COMPUTE, &surfaces);
if (result != VK_SUCCESS) {
assert(result == VK_ERROR_OUT_OF_DEVICE_MEMORY);
+
result = anv_cmd_buffer_new_binding_table_block(cmd_buffer);
- assert(result == VK_SUCCESS);
+ if (result != VK_SUCCESS)
+ return result;
/* Re-emit state base addresses so we get the new surface state base
* address before we start emitting binding tables etc.