mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
radv/rt: Only do ploc atomicCompSwap once per workgroup
There is no need to do this for every invocation in the wave. Improves GravityMark scores by 5%. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30483>
This commit is contained in:
parent
7983c6c14d
commit
a3df3ebab4
1 changed files with 10 additions and 4 deletions
|
|
@ -216,10 +216,16 @@ main(void)
|
|||
return;
|
||||
}
|
||||
|
||||
atomicCompSwap(DEREF(args.header).sync_data.task_counts[0], 0xFFFFFFFF,
|
||||
DEREF(args.header).active_leaf_count);
|
||||
atomicCompSwap(DEREF(args.header).sync_data.current_phase_end_counter, 0xFFFFFFFF,
|
||||
DIV_ROUND_UP(DEREF(args.header).active_leaf_count, gl_WorkGroupSize.x));
|
||||
/* Only initialize sync_data once per workgroup. For intra-workgroup synchronization,
|
||||
* fetch_task contains a workgroup-scoped control+memory barrier.
|
||||
*/
|
||||
if (gl_LocalInvocationIndex == 0) {
|
||||
atomicCompSwap(DEREF(args.header).sync_data.task_counts[0], 0xFFFFFFFF,
|
||||
DEREF(args.header).active_leaf_count);
|
||||
atomicCompSwap(DEREF(args.header).sync_data.current_phase_end_counter, 0xFFFFFFFF,
|
||||
DIV_ROUND_UP(DEREF(args.header).active_leaf_count, gl_WorkGroupSize.x));
|
||||
}
|
||||
|
||||
REF(ploc_prefix_scan_partition)
|
||||
partitions = REF(ploc_prefix_scan_partition)(args.prefix_scan_partitions);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue