[Bf-blender-cvs] [959b06b] master: Fix type mismatch causing the buffer overflow in D810

Alexander Romanov noreply at git.blender.org
Tue Aug 30 18:09:44 CEST 2016


Commit: 959b06b3c85fc8a6df2b9983e016ee59e9491b64
Author: Alexander Romanov
Date:   Tue Aug 30 17:15:26 2016 +0300
Branches: master
https://developer.blender.org/rB959b06b3c85fc8a6df2b9983e016ee59e9491b64

Fix type mismatch causing the buffer overflow in D810

===================================================================

M	source/blender/gpu/shaders/gpu_shader_material.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 845a787..119bfb6 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -2185,11 +2185,11 @@ void shade_madd_clamped(vec4 col, vec4 col1, vec4 col2, out vec4 outcol)
 	outcol = col + max(col1 * col2, vec4(0.0, 0.0, 0.0, 0.0));
 }
 
-void env_apply(vec4 col, vec4 hor, vec4 zen, vec4 f, mat4 vm, vec3 vn, out vec4 outcol)
+void env_apply(vec4 col, vec3 hor, vec3 zen, vec4 f, mat4 vm, vec3 vn, out vec4 outcol)
 {
 	vec3 vv = normalize(vm[2].xyz);
 	float skyfac = 0.5 * (1.0 + dot(vn, -vv));
-	outcol = col + f * mix(hor, zen, skyfac);
+	outcol = col + f * vec4(mix(hor, zen, skyfac), 0);
 }
 
 void shade_maddf(vec4 col, float f, vec4 col1, out vec4 outcol)




More information about the Bf-blender-cvs mailing list