lavapipe: reset shader constant buffers after execution

Otherwise this leads to a use-after-free
dEQP-VK.synchronization.op.single_queue.fence.write_fill_buffer_read_ssbo_vertex.buffer_16384
when run after any test using a ubo in the fragment shader.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8912>
This commit is contained in:
Dave Airlie 2021-02-08 17:31:36 +10:00
parent c10b785490
commit 8ed874d73f
1 changed files with 4 additions and 0 deletions

View File

@ -2793,6 +2793,10 @@ VkResult lvp_execute_cmds(struct lvp_device *device,
state.pctx->bind_sampler_states(state.pctx, s, 0, PIPE_MAX_SAMPLERS, state.ss_cso[s]);
state.pctx->set_shader_images(state.pctx, s, 0, 0, device->physical_device->max_images, NULL);
state.pctx->set_constant_buffer(state.pctx, s, 0, false, NULL);
for (unsigned idx = 0; idx < state.num_const_bufs[s]; idx++)
state.pctx->set_constant_buffer(state.pctx, s, idx + 1, false, NULL);
}
free(state.pending_clear_aspects);