diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2024-03-06 14:38:35 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-23 17:20:40 +0000 |
commit | fb323ae46b497a7d41fe510092dd6cfa0cfd04cc (patch) | |
tree | ccf6cfd67fd20ede006497c68b5d9159798d5a6a /src/amd/vulkan/radv_cmd_buffer.c | |
parent | 758e6d9005b030ea49783f32b3d71dca5b95e157 (diff) |
radv: rework the number of tess patches computation
This uses the same helper as RadeonSI which seems more robust and more
optimal (eg. it reduces the number of patches to increase occupancy).
fossils-db (NAVI21):
Totals from 638 (0.80% of 79395) affected shaders:
MaxWaves: 13182 -> 13142 (-0.30%)
Instrs: 419446 -> 419322 (-0.03%); split: -0.08%, +0.05%
CodeSize: 2261408 -> 2261200 (-0.01%); split: -0.06%, +0.05%
VGPRs: 32560 -> 32600 (+0.12%)
LDS: 4648960 -> 5343232 (+14.93%); split: -1.67%, +16.61%
Latency: 4812105 -> 4811141 (-0.02%); split: -0.04%, +0.02%
InvThroughput: 1159924 -> 1153998 (-0.51%); split: -0.60%, +0.09%
VClause: 7837 -> 7871 (+0.43%); split: -0.36%, +0.79%
SClause: 9378 -> 9381 (+0.03%); split: -0.21%, +0.25%
Copies: 28451 -> 28211 (-0.84%); split: -0.97%, +0.13%
PreVGPRs: 25404 -> 25411 (+0.03%); split: -0.06%, +0.09%
VALU: 278086 -> 277975 (-0.04%); split: -0.11%, +0.07%
SALU: 43657 -> 43617 (-0.09%)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28015>
Diffstat (limited to 'src/amd/vulkan/radv_cmd_buffer.c')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index ebf623908cf..4299ab72356 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2647,17 +2647,16 @@ radv_emit_patch_control_points(struct radv_cmd_buffer *cmd_buffer) */ if (cmd_buffer->state.uses_dynamic_patch_control_points) { /* Compute the number of patches. */ - cmd_buffer->state.tess_num_patches = get_tcs_num_patches( - d->vk.ts.patch_control_points, tcs->info.tcs.tcs_vertices_out, vs->info.vs.num_linked_outputs, + cmd_buffer->state.tess_num_patches = radv_get_tcs_num_patches( + pdev, d->vk.ts.patch_control_points, tcs->info.tcs.tcs_vertices_out, vs->info.vs.num_linked_outputs, tcs->info.tcs.num_lds_per_vertex_outputs, tcs->info.tcs.num_lds_per_patch_outputs, - tcs->info.tcs.num_linked_outputs, tcs->info.tcs.num_linked_patch_outputs, pdev->hs.tess_offchip_block_dw_size, - pdev->info.gfx_level, pdev->info.family); + tcs->info.tcs.num_linked_outputs, tcs->info.tcs.num_linked_patch_outputs); /* Compute the LDS size. */ cmd_buffer->state.tess_lds_size = - calculate_tess_lds_size(pdev->info.gfx_level, d->vk.ts.patch_control_points, tcs->info.tcs.tcs_vertices_out, - vs->info.vs.num_linked_outputs, cmd_buffer->state.tess_num_patches, - tcs->info.tcs.num_lds_per_vertex_outputs, tcs->info.tcs.num_lds_per_patch_outputs); + radv_get_tess_lds_size(pdev, d->vk.ts.patch_control_points, tcs->info.tcs.tcs_vertices_out, + vs->info.vs.num_linked_outputs, cmd_buffer->state.tess_num_patches, + tcs->info.tcs.num_lds_per_vertex_outputs, tcs->info.tcs.num_lds_per_patch_outputs); } ls_hs_config = S_028B58_NUM_PATCHES(cmd_buffer->state.tess_num_patches) | |