From d966ce718b9d93fd74b68556903b72c29a52ebd3 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 22 Aug 2022 10:36:38 +0200 Subject: EEVEE-Next: Fix shader compilation error. Due to a copy-paste error there was an out of bound read. Some drivers didn't complain about it, others did. This patch fixes the compilation error by accessing the array within bounds. --- source/blender/draw/intern/shaders/common_intersect_lib.glsl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/draw') diff --git a/source/blender/draw/intern/shaders/common_intersect_lib.glsl b/source/blender/draw/intern/shaders/common_intersect_lib.glsl index 708d361029a..33378588553 100644 --- a/source/blender/draw/intern/shaders/common_intersect_lib.glsl +++ b/source/blender/draw/intern/shaders/common_intersect_lib.glsl @@ -353,8 +353,7 @@ bool intersect(IsectFrustum i_frustum, Box box) bool intersect(IsectFrustum i_frustum, Sphere sphere) { bool intersects = true; - - for (int p = 0; p < 8; ++p) { + for (int p = 0; p < 6; ++p) { float dist_to_plane = dot(i_frustum.planes[p], vec4(sphere.center, 1.0)); if (dist_to_plane < -sphere.radius) { intersects = false; -- cgit v1.2.3