Module: Mesa Branch: main Commit: 3fd0ff21e0cdc3aac1dc3966b767d1809335d9b3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3fd0ff21e0cdc3aac1dc3966b767d1809335d9b3
Author: Konstantin Seurer <[email protected]> Date: Wed Aug 23 14:17:18 2023 +0200 radv: Merge the sync_data and header initialization Reviewed-by: Friedrich Vock <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24846> --- src/amd/vulkan/radv_acceleration_structure.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/amd/vulkan/radv_acceleration_structure.c b/src/amd/vulkan/radv_acceleration_structure.c index 271cad0103b..0def12d2bb4 100644 --- a/src/amd/vulkan/radv_acceleration_structure.c +++ b/src/amd/vulkan/radv_acceleration_structure.c @@ -1008,16 +1008,6 @@ ploc_build_internal(VkCommandBuffer commandBuffer, uint32_t infoCount, if (bvh_states[i].config.extended_sah != extended_sah) continue; - struct radv_global_sync_data initial_sync_data = { - .current_phase_end_counter = TASK_INDEX_INVALID, - /* Will be updated by the first PLOC shader invocation */ - .task_counts = {TASK_INDEX_INVALID, TASK_INDEX_INVALID}, - }; - radv_update_buffer_cp(cmd_buffer, - pInfos[i].scratchData.deviceAddress + bvh_states[i].scratch.header_offset + - offsetof(struct radv_ir_header, sync_data), - &initial_sync_data, sizeof(struct radv_global_sync_data)); - uint32_t src_scratch_offset = bvh_states[i].scratch_offset; uint32_t dst_scratch_offset = (src_scratch_offset == bvh_states[i].scratch.sort_buffer_offset[0]) ? bvh_states[i].scratch.sort_buffer_offset[1] @@ -1235,6 +1225,12 @@ radv_CmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t i .max_bounds = {0x80000000, 0x80000000, 0x80000000}, .dispatch_size_y = 1, .dispatch_size_z = 1, + .sync_data = + { + .current_phase_end_counter = TASK_INDEX_INVALID, + /* Will be updated by the first PLOC shader invocation */ + .task_counts = {TASK_INDEX_INVALID, TASK_INDEX_INVALID}, + }, }; radv_update_buffer_cp(cmd_buffer, pInfos[i].scratchData.deviceAddress + bvh_states[i].scratch.header_offset,
