From 618e825e57d65e149fa9822dc644122268e2dbde Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Fri, 25 Mar 2016 22:50:25 +0100 Subject: [PATCH] wined3d: Don't flag vertex color clamping for changes on core profile. glClampColorARB(GL_CLAMP_VERTEX_COLOR) is not supported on core profile and we can't use builtin color varyings there anyway. Signed-off-by: Matteo Bruni Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/glsl_shader.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 9e6a631fcfb..7c367e4f522 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -7345,14 +7345,24 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const pshader ? min(pshader->limits->constant_float, gl_info->limits.glsl_ps_float_constants) : 0); checkGLcall("Find glsl program uniform locations"); - if (pshader && pshader->reg_maps.shader_version.major >= 3 - && pshader->u.ps.declared_in_count > vec4_varyings(3, gl_info)) + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { - TRACE("Shader %d needs vertex color clamping disabled.\n", program_id); - entry->vs.vertex_color_clamp = GL_FALSE; + if (pshader && pshader->reg_maps.shader_version.major >= 3 + && pshader->u.ps.declared_in_count > vec4_varyings(3, gl_info)) + { + TRACE("Shader %d needs vertex color clamping disabled.\n", program_id); + entry->vs.vertex_color_clamp = GL_FALSE; + } + else + { + entry->vs.vertex_color_clamp = GL_FIXED_ONLY_ARB; + } } else { + /* With core profile we never change vertex_color_clamp from + * GL_FIXED_ONLY_MODE (which is also the initial value) so we never call + * glClampColorARB(). */ entry->vs.vertex_color_clamp = GL_FIXED_ONLY_ARB; }