radv/rt: Divide by the correct workgroup size
authorFriedrich Vock <friedrich.vock@gmx.de>
Sun, 15 Jan 2023 20:54:50 +0000 (21:54 +0100)
committerEric Engestrom <eric@engestrom.ch>
Thu, 26 Jan 2023 15:40:30 +0000 (15:40 +0000)
Improves build performance by around 25%.

Fixes: 9369b407 ("radv: Use PLOC for BVH building")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20717>
(cherry picked from commit eab2c3995132f8cd1e3e9ee56eedaf17448aa157)

.pick_status.json
src/amd/vulkan/radv_acceleration_structure.c

index c197791..abb45ef 100644 (file)
         "description": "radv/rt: Divide by the correct workgroup size",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "9369b407250b089d54e2247a7c8c10c65188c551"
     },
index 7efb9e9..b4caaf0 100644 (file)
@@ -757,7 +757,8 @@ ploc_build_internal(VkCommandBuffer commandBuffer, uint32_t infoCount,
       radv_CmdPushConstants(commandBuffer,
                             cmd_buffer->device->meta_state.accel_struct_build.ploc_p_layout,
                             VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(consts), &consts);
-      radv_CmdDispatch(commandBuffer, MAX2(DIV_ROUND_UP(bvh_states[i].node_count, 64), 1), 1, 1);
+      radv_CmdDispatch(commandBuffer,
+                       MAX2(DIV_ROUND_UP(bvh_states[i].node_count, PLOC_WORKGROUP_SIZE), 1), 1, 1);
    }
 }