From 548b8f51c9b8ab6a3c830618d6e788ec0c6dff43 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 7 Nov 2014 13:17:26 +0500 Subject: 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. --- source/blender/gpu/shaders/gpu_shader_material.glsl | 2 +- source/blender/nodes/shader/nodes/node_shader_mixRgb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 4e910cd220a..d5bc65eff4f 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 7d052810489..f911fa058dc 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; } -- cgit v1.2.3