diff options
-rw-r--r-- | src/intel/vulkan/anv_cmd_buffer.c | 4 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index a6ad48a8627..b3fd02fef53 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -117,6 +117,8 @@ anv_cmd_state_reset(struct anv_cmd_buffer *cmd_buffer) { struct anv_cmd_state *state = &cmd_buffer->state; + cmd_buffer->batch.status = VK_SUCCESS; + memset(&state->descriptors, 0, sizeof(state->descriptors)); memset(&state->push_constants, 0, sizeof(state->push_constants)); memset(state->binding_tables, 0, sizeof(state->binding_tables)); @@ -185,6 +187,8 @@ static VkResult anv_create_cmd_buffer( if (cmd_buffer == NULL) return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); + cmd_buffer->batch.status = VK_SUCCESS; + cmd_buffer->_loader_data.loaderMagic = ICD_LOADER_MAGIC; cmd_buffer->device = device; cmd_buffer->pool = pool; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index eec1cd6f8d0..fbf62255c1c 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -704,6 +704,15 @@ struct anv_batch { */ VkResult (*extend_cb)(struct anv_batch *, void *); void * user_data; + + /** + * Current error status of the command buffer. Used to track inconsistent + * or incomplete command buffer states that are the consequence of run-time + * errors such as out of memory scenarios. We want to track this in the + * batch because the command buffer object is not visible to some parts + * of the driver. + */ + VkResult status; }; void *anv_batch_emit_dwords(struct anv_batch *batch, int num_dwords); |