anv: handle allocation failure in anv_batch_emit_batch()

v2:
 - Call the error handler (Topi)

Fixes:
dEQP-VK.api.out_of_host_memory.cmd_execute_commands

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Iago Toral Quiroga 2017-03-03 11:17:03 +01:00
parent a8ce8e3542
commit 9e69409fcf
1 changed files with 7 additions and 2 deletions

View File

@ -222,8 +222,13 @@ anv_batch_emit_batch(struct anv_batch *batch, struct anv_batch *other)
size = other->next - other->start;
assert(size % 4 == 0);
if (batch->next + size > batch->end)
batch->extend_cb(batch, batch->user_data);
if (batch->next + size > batch->end) {
VkResult result = batch->extend_cb(batch, batch->user_data);
if (result != VK_SUCCESS) {
anv_batch_set_error(batch, result);
return;
}
}
assert(batch->next + size <= batch->end);