From: Jason Ekstrand Date: Sat, 23 Jan 2016 06:57:02 +0000 (-0800) Subject: anv/cmd_buffer: Zero out binding tables and samplers in state_reset X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a804d82ef6062cc16c5c3beb254560bfe448bfe0;p=mesa.git anv/cmd_buffer: Zero out binding tables and samplers in state_reset This fixes a use of an undefined value if the client uses push constants in a stage without ever setting any descriptors on GEN8-9. --- diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index fe85e3e164e..d2cbf87578a 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -117,6 +117,11 @@ anv_cmd_state_reset(struct anv_cmd_buffer *cmd_buffer) 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)); + memset(state->samplers, 0, sizeof(state->samplers)); + + /* 0 isn't a valid config. This ensures that we always configure L3$. */ + cmd_buffer->state.current_l3_config = 0; state->dirty = ~0; state->vb_dirty = 0; @@ -237,9 +242,6 @@ static VkResult anv_create_cmd_buffer( cmd_buffer->level = level; cmd_buffer->state.attachments = NULL; - /* 0 isn't a valid config. This ensures that we always configure L3$. */ - cmd_buffer->state.current_l3_config = 0; - result = anv_cmd_buffer_init_batch_bo_chain(cmd_buffer); if (result != VK_SUCCESS) goto fail;