Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2022-08-22 11:36:38 +0300
committerJeroen Bakker <jeroen@blender.org>2022-08-22 11:36:38 +0300
commitd966ce718b9d93fd74b68556903b72c29a52ebd3 (patch)
tree476fcaca78ab881e2dca28330a2e32650dc328ab /source/blender/draw
parent0aeae0d0b9810fea0214fc60d41652684135c177 (diff)
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.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/intern/shaders/common_intersect_lib.glsl3
1 files changed, 1 insertions, 2 deletions
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;