summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2023-10-30 15:26:15 +0100
committerEric Engestrom <eric@engestrom.ch>2023-11-01 12:48:16 +0000
commit3cb8275141775d1eb3a2e7aee43a9755b9e86835 (patch)
treeea4d82aadb086e5ce7b24191021a8e20e56c9e2d
parent14fac5200d4e5384c71d999318c9f891f6d3822c (diff)
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> (cherry picked from commit e4a1bc70dd739ca8addddc940af08312b038e288)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 671845e903c..694efedf315 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4,7 +4,7 @@
"description": "radv: bind the non-dynamic graphics state from the pipeline unconditionally",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index d8a0ab5caf3..57b720520a8 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -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);