vulkan/bvh: Move first PLOC task_count fetch inside PHASE

Otherwise, the memory fetch is not protected by the global sync and
memory barriers and there is a chance to read a stale (or just wrong)
task count.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34178>
This commit is contained in:
Natalie Vock
2025-03-25 13:11:05 +01:00
committed by Marge Bot
parent c1e1d86bd1
commit 8b0271050a
+1 -1
View File
@@ -278,12 +278,12 @@ main(void)
uint32_t task_index = fetch_task(args.header, false);
for (uint iter = 0;; ++iter) {
uint32_t current_task_count = task_count(args.header);
if (task_index == TASK_INDEX_INVALID)
break;
/* Find preferred partners and merge them */
PHASE (args.header) {
uint32_t current_task_count = task_count(args.header);
uint32_t base_index = task_index - gl_LocalInvocationID.x;
uint32_t neighbourhood_overlap = min(PLOC_NEIGHBOURHOOD, base_index);
uint32_t double_neighbourhood_overlap = min(2 * PLOC_NEIGHBOURHOOD, base_index);