diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-07 11:17:26 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-07 11:17:26 +0300 |
commit | 548b8f51c9b8ab6a3c830618d6e788ec0c6dff43 (patch) | |
tree | 841d3d48895bd7d36e2f2d7a6407f6b831fc5cef | |
parent | 0627bc22f598651cf86ee629d8211ebee7cc85ed (diff) |
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.
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 2 | ||||
-rw-r--r-- | 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; } |