Fix #124060: EEVEE raytracing on Intel Arc

EEVEE Raytracing on Intel Arc wasn't working as there were no rays
generated. The reason was that the raytract tile compact shader
didn't set count the correct tiles it needed due to atomic operations
that were initialized without atomic.

This PR solves the issue by using atomic operations to initialize
the counts. We also tried memory barriers but that didn't fix the
problem.

Other shaders were also tested if they have this issue, but they were
setup in a specific shader or where done using a race condition (SSS) which
is working.

Pull Request: https://projects.blender.org/blender/blender/pulls/124213
This commit is contained in:
Jeroen Bakker
2024-07-05 12:37:44 +02:00
parent a796589ed1
commit 0597cd4f76

View File

@@ -17,11 +17,26 @@ void main()
ivec2 tile = ivec2(gl_GlobalInvocationID.xy);
if (all(equal(tile, ivec2(0)))) {
raytrace_tracing_dispatch_buf.num_groups_y = 1;
raytrace_denoise_dispatch_buf.num_groups_y = 1;
raytrace_tracing_dispatch_buf.num_groups_z = 1;
raytrace_denoise_dispatch_buf.num_groups_z = 1;
/* Workaround: Using atomics to initialize num groups on Windows/Intel GPUs. On Windows/Intel
* Arc assignments are ignored when shader later on accesses the variables using atomic
* operations.
*
* Ref #124060.
*/
#if defined(GPU_INTEL) && defined(OS_WIN)
atomicExchange(raytrace_tracing_dispatch_buf.num_groups_y, 1u);
atomicExchange(raytrace_denoise_dispatch_buf.num_groups_y, 1u);
atomicExchange(raytrace_tracing_dispatch_buf.num_groups_z, 1u);
atomicExchange(raytrace_denoise_dispatch_buf.num_groups_z, 1u);
#else
raytrace_tracing_dispatch_buf.num_groups_y = 1u;
raytrace_denoise_dispatch_buf.num_groups_y = 1u;
raytrace_tracing_dispatch_buf.num_groups_z = 1u;
raytrace_denoise_dispatch_buf.num_groups_z = 1u;
#endif
}
if (!in_image_range(tile, tile_raytrace_tracing_img)) {