Matteo Bruni : wined3d: Don' t set legacy light and texture environment state on core profile contexts.
Module: wine Branch: master Commit: ccac958b582d5c5c535d28fcfe0cb1b8a7334037 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ccac958b582d5c5c535d28fcfe... Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Mar 28 23:03:29 2016 +0200 wined3d: Don't set legacy light and texture environment state on core profile contexts. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 096cbac..dfeb4fb 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1864,21 +1864,18 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, TRACE("Setting up the screen\n"); - gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); - checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);"); - - gl_info->gl_ops.gl.p_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); - checkGLcall("glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);"); - - gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); - checkGLcall("glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);"); + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + { + gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); + checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);"); - gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment); - checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);"); - gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, device->surface_alignment);"); + gl_info->gl_ops.gl.p_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + checkGLcall("glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);"); - if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); + checkGLcall("glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);"); + } + else { GLuint vao; @@ -1887,6 +1884,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, checkGLcall("creating VAO"); } + gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment); + checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);"); + gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, device->surface_alignment);"); + if (gl_info->supported[ARB_VERTEX_BLEND]) { /* Direct3D always uses n-1 weights for n world matrices and uses
participants (1)
-
Alexandre Julliard