Module: Mesa Branch: main Commit: 7397502a1fd242c60d4fe1b357f4682150033a35 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7397502a1fd242c60d4fe1b357f4682150033a35
Author: Samuel Pitoiset <[email protected]> Date: Wed Oct 11 09:56:42 2023 +0200 radv: disable primitive restart for non-indexed draws on GFX11 Primitive restart is also applied to non-indexed draws on AMD GPUs. On GFX11, DISABLE_FOR_AUTO_INDEX can be set but we will need a different solution for older GPUs. This fixes all line related flakes in CI (at least). Cc: mesa-stable Signed-off-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25639> --- src/amd/ci/radv-navi31-aco-flakes.txt | 3 --- src/amd/vulkan/radv_cmd_buffer.c | 7 ++++++- src/amd/vulkan/si_cmd_buffer.c | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/amd/ci/radv-navi31-aco-flakes.txt b/src/amd/ci/radv-navi31-aco-flakes.txt index 5d4cc3d3c47..5f2ac41d37e 100644 --- a/src/amd/ci/radv-navi31-aco-flakes.txt +++ b/src/amd/ci/radv-navi31-aco-flakes.txt @@ -11,9 +11,6 @@ dEQP-VK.mesh_shader.ext.query.all_queries.triangles.no_reset.get.no_wait.draw.32 dEQP-VK.mesh_shader.ext.query.all_queries.triangles.reset_after.copy.no_wait.draw.64bit.with_availability.no_blocks.task_mesh.inside_rp.multi_view.with_secondary dEQP-VK.mesh_shader.ext.query.all_queries.triangles.reset_after.copy.wait.draw.64bit.with_availability.multiple_blocks.task_mesh.include_rp.single_view.only_primary dEQP-VK.mesh_shader.ext.query.mesh_invs_query.triangles.reset_before.copy.no_wait.indirect_draw.32bit.no_availability.single_block.task_mesh.inside_rp.single_view.with_secondary -dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.before_good_static.topology_line_geom -dEQP-VK.pipeline.monolithic.extended_dynamic_state.between_pipelines.topology_line_geom -dEQP-VK.pipeline.monolithic.extended_dynamic_state.cmd_buffer_start.topology_line_geom dEQP-VK.rasterization.provoking_vertex.transform_feedback.per_pipeline.line_list dEQP-VK.rasterization.provoking_vertex.transform_feedback.per_pipeline.line_list_with_adjacency dEQP-VK.rasterization.provoking_vertex.transform_feedback.per_pipeline.triangle_list diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 471aa6a7173..652f145e033 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2391,7 +2391,12 @@ radv_emit_primitive_restart_enable(struct radv_cmd_buffer *cmd_buffer) const bool en = d->vk.ia.primitive_restart_enable; if (gfx_level >= GFX11) { - radeon_set_uconfig_reg(cs, R_03092C_GE_MULTI_PRIM_IB_RESET_EN, en); + radeon_set_uconfig_reg(cs, R_03092C_GE_MULTI_PRIM_IB_RESET_EN, + S_03092C_RESET_EN(en) | + /* This disables primitive restart for non-indexed draws. + * By keeping this set, we don't have to unset RESET_EN + * for non-indexed draws. */ + S_03092C_DISABLE_FOR_AUTO_INDEX(1)); } else if (gfx_level >= GFX9) { radeon_set_uconfig_reg(cs, R_03092C_VGT_MULTI_PRIM_IB_RESET_EN, en); } else { diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c index 95ae6eedeaf..ea35f10d851 100644 --- a/src/amd/vulkan/si_cmd_buffer.c +++ b/src/amd/vulkan/si_cmd_buffer.c @@ -619,6 +619,11 @@ si_emit_graphics(struct radv_device *device, struct radeon_cmdbuf *cs) radeon_set_config_reg(cs, R_008B10_PA_SC_LINE_STIPPLE_STATE, 0); } + if (physical_device->rad_info.gfx_level >= GFX11) { + /* Disable primitive restart for all non-indexed draws. */ + radeon_set_uconfig_reg(cs, R_03092C_GE_MULTI_PRIM_IB_RESET_EN, S_03092C_DISABLE_FOR_AUTO_INDEX(1)); + } + si_emit_compute(device, cs); }
