v3dv/cmd_buffer: always bind pipeline static state

Even if the pipeline is the same.

The followin sequence, used on
dEQP-VK.dynamic_state.*.double_static_bind tests, is valid:

   1. Bind pipeline with some static state.
   2. Set state command for that static state (to a bad value).
   3. Bind the same pipeline again.
   4. Draw.

So on 3 we need to ensure to load again the pipeline static state.

Fixes: dEQP-VK.dynamic_state.*.double_static_bind

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28897>
This commit is contained in:
Alejandro Piñeiro 2024-04-24 11:44:11 +02:00 committed by Marge Bot
parent 1f07f5a79b
commit e14f5252fa

View file

@ -2205,13 +2205,18 @@ bind_graphics_pipeline(struct v3dv_cmd_buffer *cmd_buffer,
struct v3dv_pipeline *pipeline)
{
assert(pipeline && !(pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT));
/* We need to unconditionally bind the pipeline static state, as the state
* could have changed (through calls to vkCmdSetXXX) between bindings of
* the same pipeline.
*/
cmd_buffer_bind_pipeline_static_state(cmd_buffer, &pipeline->dynamic_state);
if (cmd_buffer->state.gfx.pipeline == pipeline)
return;
cmd_buffer->state.gfx.pipeline = pipeline;
cmd_buffer_bind_pipeline_static_state(cmd_buffer, &pipeline->dynamic_state);
cmd_buffer->state.dirty |= V3DV_CMD_DIRTY_PIPELINE;
}