From 3b329e195e340b64d090c57a291d7ed9d41686c7 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 21 Jun 2023 09:09:01 +0200 Subject: [PATCH] radv: only dirty the index type when necessary with DGC This should only be needed for non-indexed draws and it's already dirty if the DGC binds an index buffer. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 3adcee48aa5..e26b46d344e 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -9365,7 +9365,13 @@ radv_CmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPre cmd_buffer->push_constant_stages |= ~0; - cmd_buffer->state.last_index_type = -1; + if (!layout->indexed && cmd_buffer->device->physical_device->rad_info.gfx_level >= GFX7) { + /* On GFX7 and later, non-indexed draws overwrite VGT_INDEX_TYPE, so the state must be + * re-emitted before the next indexed draw. + */ + cmd_buffer->state.last_index_type = -1; + } + cmd_buffer->state.last_num_instances = -1; cmd_buffer->state.last_vertex_offset_valid = false; cmd_buffer->state.last_first_instance = -1;