Skip to content
Snippets Groups Projects
Commit 0597cd4f authored by Jeroen Bakker's avatar Jeroen Bakker
Browse files

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
parent a796589e
Branches
Tags
No related merge requests found
...@@ -17,11 +17,26 @@ void main() ...@@ -17,11 +17,26 @@ void main()
ivec2 tile = ivec2(gl_GlobalInvocationID.xy); ivec2 tile = ivec2(gl_GlobalInvocationID.xy);
if (all(equal(tile, ivec2(0)))) { 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; /* Workaround: Using atomics to initialize num groups on Windows/Intel GPUs. On Windows/Intel
raytrace_denoise_dispatch_buf.num_groups_z = 1; * 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)) { if (!in_image_range(tile, tile_raytrace_tracing_img)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment