From ac66a49ba6a255b13b27dfab1e767bfb6da8f3ff Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Fri, 10 Nov 2023 18:03:08 +0100 Subject: [PATCH] tu: Fix re-emitting VS param state after it is re-enabled We need to always re-emit it if it was disabled. Fixes vertex/instance offset in a direct draw after an indirect draw. Cc: mesa-stable Part-of: (cherry picked from commit 6be6b4ca711b157d0d92b4942b19eb74e71ed04f) --- .pick_status.json | 2 +- src/freedreno/ci/freedreno-a630-fails.txt | 1 - src/freedreno/ci/freedreno-a660-fails.txt | 2 -- src/freedreno/vulkan/tu_cmd_buffer.cc | 4 +++- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 4ef662c..23d2443 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -384,7 +384,7 @@ "description": "tu: Fix re-emitting VS param state after it is re-enabled", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/freedreno/ci/freedreno-a630-fails.txt b/src/freedreno/ci/freedreno-a630-fails.txt index ecd5de6..c4c169b 100644 --- a/src/freedreno/ci/freedreno-a630-fails.txt +++ b/src/freedreno/ci/freedreno-a630-fails.txt @@ -881,7 +881,6 @@ dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statis dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_3.pgq_32bit_xfb_64bit.triangle_strip.indirect,Fail dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_3.pgq_64bit_xfb_32bit.point_list.draw,Fail dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_3.pgq_64bit_xfb_32bit.triangle_list_with_adjacency.indirect,Fail -dEQP-VK.transform_feedback.simple.backward_dependency_indirect_endqueryindexed_streamid_0,Fail dynamic-dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint.compatibility_depth_zero_stencil_zero_testing_stencil,Fail gmem-dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.all_formats.color.2d_to_1d.b4g4r4a4_unorm_pack16.r16_sfloat.optimal_general,Fail gmem-dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.all_formats.color.2d_to_1d.r16_uint.r16_sfloat.optimal_optimal,Fail diff --git a/src/freedreno/ci/freedreno-a660-fails.txt b/src/freedreno/ci/freedreno-a660-fails.txt index 975102e..af00611 100644 --- a/src/freedreno/ci/freedreno-a660-fails.txt +++ b/src/freedreno/ci/freedreno-a660-fails.txt @@ -1053,8 +1053,6 @@ dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statis dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_3.pgq_64bit_xfb_32bit.triangle_strip.indirect,Fail dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_3.pgq_64bit_xfb_32bit.triangle_strip_with_adjacency.draw,Fail dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_3.pgq_64bit_xfb_32bit.triangle_strip_with_adjacency.indirect,Fail -dEQP-VK.transform_feedback.simple.backward_dependency_indirect_beginqueryindexed_streamid_0,Fail -dEQP-VK.transform_feedback.simple.backward_dependency_indirect_no_offset_array,Fail gmem-dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.all_formats.color.2d_to_1d.b4g4r4a4_unorm_pack16.r16_sfloat.general_general,Fail gmem-dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.all_formats.color.2d_to_1d.b4g4r4a4_unorm_pack16.r16_sfloat.optimal_general,Fail gmem-dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.all_formats.color.2d_to_1d.b4g4r4a4_unorm_pack16.r16_sfloat.optimal_optimal,Fail diff --git a/src/freedreno/vulkan/tu_cmd_buffer.cc b/src/freedreno/vulkan/tu_cmd_buffer.cc index 23a1e4a..4aa3ab77 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.cc +++ b/src/freedreno/vulkan/tu_cmd_buffer.cc @@ -4976,10 +4976,12 @@ tu6_emit_vs_params(struct tu_cmd_buffer *cmd, uint32_t offset = vs_params_offset(cmd); /* Beside re-emitting params when they are changed, we should re-emit - * them after constants are invalidated via HLSQ_INVALIDATE_CMD. + * them after constants are invalidated via HLSQ_INVALIDATE_CMD or after we + * emit an empty vs params. */ if (!(cmd->state.dirty & (TU_CMD_DIRTY_DRAW_STATE | TU_CMD_DIRTY_VS_PARAMS | TU_CMD_DIRTY_PROGRAM)) && + cmd->state.vs_params.iova && (offset == 0 || draw_id == cmd->state.last_vs_params.draw_id) && vertex_offset == cmd->state.last_vs_params.vertex_offset && first_instance == cmd->state.last_vs_params.first_instance) { -- 2.7.4