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.
This commit is contained in:
Sergey Sharybin 2014-11-07 13:17:26 +05:00
parent 0627bc22f5
commit 548b8f51c9
2 changed files with 2 additions and 2 deletions

@ -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);
}

@ -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;
}