Joachim Priesner : wined3d: Load ModelView matrix for glLightfv calls.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 13 07:42:02 CDT 2015
Module: wine
Branch: master
Commit: 8fff427bc0cc13e5e081da7a90af8c660e667698
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8fff427bc0cc13e5e081da7a90af8c660e667698
Author: Joachim Priesner <joachim.priesner at web.de>
Date: Sat Apr 11 17:16:52 2015 +0200
wined3d: Load ModelView matrix for glLightfv calls.
Analogous to the light() function in state.c, the correct ModelView
matrix has to be loaded when glLightfv is called.
---
dlls/wined3d/glsl_shader.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 1a1b6b0..2422982 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -7208,6 +7208,11 @@ void glsl_vertex_pipe_view(struct wined3d_context *context, const struct wined3d
context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW;
+ /* Light settings are affected by the ModelView transform in OpenGL, the View transform in Direct3D. */
+ gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW);
+ gl_info->gl_ops.gl.p_glPushMatrix();
+ gl_info->gl_ops.gl.p_glLoadMatrixf(&state->transforms[WINED3D_TS_VIEW]._11);
+
for (k = 0; k < gl_info->limits.lights; ++k)
{
if (!(light = state->lights[k]))
@@ -7218,6 +7223,8 @@ void glsl_vertex_pipe_view(struct wined3d_context *context, const struct wined3d
checkGLcall("glLightfv dirn");
}
+ gl_info->gl_ops.gl.p_glPopMatrix();
+
for (k = 0; k < gl_info->limits.clipplanes; ++k)
{
if (!isStateDirty(context, STATE_CLIPPLANE(k)))
More information about the wine-cvs
mailing list