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.
This commit is contained in:
Jason Ekstrand
2016-01-22 22:57:02 -08:00
parent 9e0bc29f80
commit a804d82ef6
+5 -3
View File
@@ -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;