From f62bc68a699dd67bdd51bb7f9a1eb067aa0ceecf Mon Sep 17 00:00:00 2001 From: Miguel Pozo Date: Fri, 18 Jul 2025 15:29:35 +0200 Subject: [PATCH] Fix #141781: EEVEE: IBL broken on Intel Iris 580 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shader was missing barriers compared to the old code. Candidate for 4.5 LTS backport. Co-authored-by: Clément Foucault Pull Request: https://projects.blender.org/blender/blender/pulls/141971 --- .../shaders/eevee_lightprobe_sphere_remap_comp.glsl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_sphere_remap_comp.glsl b/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_sphere_remap_comp.glsl index 7d9eaaceaa6..e16a322b8dc 100644 --- a/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_sphere_remap_comp.glsl +++ b/source/blender/draw/engines/eevee/shaders/eevee_lightprobe_sphere_remap_comp.glsl @@ -137,13 +137,15 @@ void main() /* OpenGL/Intel drivers have known issues where it isn't able to compile barriers inside for * loops. Unroll is needed as driver might decide to not unroll in shaders with more * complexity. */ - [[gpu::unroll(10)]] for (uint stride = group_size / 2; stride > 0; stride /= 2) + [[gpu::unroll]] for (uint i = 0; i < 10; i++) { barrier(); + uint stride = group_size >> (i + 1u); if (local_index < stride) { local_radiance[local_index] += local_radiance[local_index + stride]; } } + barrier(); if (gl_LocalInvocationIndex == 0u) { out_sun[work_group_index].radiance = local_radiance[0].xyz; @@ -158,9 +160,10 @@ void main() /* OpenGL/Intel drivers have known issues where it isn't able to compile barriers inside for * loops. Unroll is needed as driver might decide to not unroll in shaders with more * complexity. */ - [[gpu::unroll(10)]] for (uint stride = group_size / 2; stride > 0; stride /= 2) + [[gpu::unroll]] for (uint i = 0; i < 10; i++) { barrier(); + uint stride = group_size >> (i + 1u); if (local_index < stride) { local_direction[local_index] += local_direction[local_index + stride]; } @@ -179,13 +182,15 @@ void main() /* OpenGL/Intel drivers have known issues where it isn't able to compile barriers inside for * loops. Unroll is needed as driver might decide to not unroll in shaders with more * complexity. */ - [[gpu::unroll(10)]] for (uint stride = group_size / 2; stride > 0; stride /= 2) + [[gpu::unroll]] for (uint i = 0; i < 10; i++) { barrier(); + uint stride = group_size >> (i + 1u); if (local_index < stride) { local_radiance[local_index] += local_radiance[local_index + stride]; } } + barrier(); if (gl_LocalInvocationIndex == 0u) { /* Find the middle point of the whole thread-group. Use it as light vector.