summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_cmd_buffer.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-01-22 22:57:02 -0800
committerJason Ekstrand <[email protected]>2016-01-22 22:57:05 -0800
commita804d82ef6062cc16c5c3beb254560bfe448bfe0 (patch)
tree4c42f55a5f98b22292604f5d998fad3556c4596b /src/vulkan/anv_cmd_buffer.c
parent9e0bc29f803429606e86ee9bef93ab71fe572c32 (diff)
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.
Diffstat (limited to 'src/vulkan/anv_cmd_buffer.c')
-rw-r--r--src/vulkan/anv_cmd_buffer.c8
1 files changed, 5 insertions, 3 deletions
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;