radv: bind the non-dynamic graphics state from the pipeline unconditionally

The following sequence is valid (although weird) but many other drivers
(including RADV) were broken:
    - bind pipeline with some static state
    - set state command for that static state (to a bad value)
    - bind the same pipeline again
    - draw

Fixes new dEQP-VK.dynamic_state.*.double_static_bind.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25954>
This commit is contained in:
Samuel Pitoiset
2023-10-30 15:26:15 +01:00
committed by Marge Bot
parent 4e912c972b
commit e4a1bc70dd
+5 -2
View File
@@ -6618,6 +6618,11 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline
case VK_PIPELINE_BIND_POINT_GRAPHICS: {
struct radv_graphics_pipeline *graphics_pipeline = radv_pipeline_to_graphics(pipeline);
/* Bind the non-dynamic graphics state from the pipeline unconditionally because some PSO
* might have been overwritten between two binds of the same pipeline.
*/
radv_bind_dynamic_state(cmd_buffer, &graphics_pipeline->dynamic_state);
if (cmd_buffer->state.graphics_pipeline == graphics_pipeline)
return;
radv_mark_descriptor_sets_dirty(cmd_buffer, pipelineBindPoint);
@@ -6686,8 +6691,6 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_RBPLUS;
}
radv_bind_dynamic_state(cmd_buffer, &graphics_pipeline->dynamic_state);
radv_bind_vs_input_state(cmd_buffer, graphics_pipeline);
radv_bind_multisample_state(cmd_buffer, &graphics_pipeline->ms);