[Bf-blender-cvs] [548b8f5] master: Fix assert failure in GPU codegen

Sergey Sharybin noreply at git.blender.org
Fri Nov 7 09:19:05 CET 2014


Commit: 548b8f51c9b8ab6a3c830618d6e788ec0c6dff43
Author: Sergey Sharybin
Date:   Fri Nov 7 13:17:26 2014 +0500
Branches: master
https://developer.blender.org/rB548b8f51c9b8ab6a3c830618d6e788ec0c6dff43

Fix assert failure in GPU codegen

Even though GLSL allows to have polymorphic functions our codegen
is not aware of this at all.

Let's rename the functions for now, but in the future would be handy
to make codegen aware of the polymorphic functions.

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

M	source/blender/gpu/shaders/gpu_shader_material.glsl
M	source/blender/nodes/shader/nodes/node_shader_mixRgb.c

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

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 4e910cd..d5bc65e 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -722,7 +722,7 @@ void invert(float fac, vec4 col, out vec4 outcol)
 	outcol.w = col.w;
 }
 
-void clamp_val(vec3 vec, vec3 min, vec3 max, out vec3 out_vec)
+void clamp_vec3(vec3 vec, vec3 min, vec3 max, out vec3 out_vec)
 {
 	out_vec = clamp(vec, min, max);
 }
diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c
index 7d05281..f911fa0 100644
--- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c
+++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c
@@ -75,7 +75,7 @@ static int gpu_shader_mix_rgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUS
 	if (ret && node->custom2 & SHD_MIXRGB_CLAMP) {
 		float min[3] = {0.0f, 0.0f, 0.0f};
 		float max[3] = {1.0f, 1.0f, 1.0f};
-		GPU_link(mat, "clamp_val", out[0].link, GPU_uniform(min), GPU_uniform(max), &out[0].link);
+		GPU_link(mat, "clamp_vec3", out[0].link, GPU_uniform(min), GPU_uniform(max), &out[0].link);
 	}
 	return ret;
 }




More information about the Bf-blender-cvs mailing list