[PATCH 3/5] wined3d: Don't flag vertex color clamping for changes on core profile.
Matteo Bruni
mbruni at codeweavers.com
Fri Mar 25 16:50:25 CDT 2016
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 <mbruni at codeweavers.com>
---
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 245f3ce..bb5159c 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;
}
--
2.7.3
More information about the wine-patches
mailing list