Module: wine Branch: master Commit: 65c8c40b18fc1445939809655d18c4fd0be64338 URL: http://source.winehq.org/git/wine.git/?a=commit;h=65c8c40b18fc1445939809655d...
Author: Matteo Bruni mbruni@codeweavers.com Date: Fri Mar 20 13:50:52 2015 +0100
wined3d: Use a separate STATE_VIEWPORT state handler in the GLSL pipeline.
---
dlls/wined3d/glsl_shader.c | 13 ++++++++++++- dlls/wined3d/state.c | 2 +- dlls/wined3d/wined3d_private.h | 2 -- 3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 4240b08..0b307d3 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -7100,6 +7100,17 @@ static void glsl_vertex_pipe_projection(struct wined3d_context *context, transform_projection(context, state, state_id); }
+static void glsl_vertex_pipe_viewport(struct wined3d_context *context, + const struct wined3d_state *state, DWORD state_id) +{ + if (!isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_PROJECTION))) + glsl_vertex_pipe_projection(context, state, STATE_TRANSFORM(WINED3D_TS_PROJECTION)); + if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_POINTSCALEENABLE)) + && state->render_states[WINED3D_RS_POINTSCALEENABLE]) + state_pscale(context, state, STATE_RENDER(WINED3D_RS_POINTSCALEENABLE)); + context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POS_FIXUP; +} + static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] = { {STATE_VDECL, {STATE_VDECL, glsl_vertex_pipe_vdecl }, WINED3D_GL_EXT_NONE }, @@ -7150,7 +7161,7 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] = {STATE_ACTIVELIGHT(6), {STATE_ACTIVELIGHT(6), light }, WINED3D_GL_EXT_NONE }, {STATE_ACTIVELIGHT(7), {STATE_ACTIVELIGHT(7), light }, WINED3D_GL_EXT_NONE }, /* Viewport */ - {STATE_VIEWPORT, {STATE_VIEWPORT, viewport_vertexpart }, WINED3D_GL_EXT_NONE }, + {STATE_VIEWPORT, {STATE_VIEWPORT, glsl_vertex_pipe_viewport}, WINED3D_GL_EXT_NONE }, /* Transform states */ {STATE_TRANSFORM(WINED3D_TS_VIEW), {STATE_TRANSFORM(WINED3D_TS_VIEW), glsl_vertex_pipe_view }, WINED3D_GL_EXT_NONE }, {STATE_TRANSFORM(WINED3D_TS_PROJECTION), {STATE_TRANSFORM(WINED3D_TS_PROJECTION), glsl_vertex_pipe_projection}, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 1c5edb3..774e6dd 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4790,7 +4790,7 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine checkGLcall("glViewport"); }
-void viewport_vertexpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +static void viewport_vertexpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { if (!isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_PROJECTION))) transform_projection(context, state, STATE_TRANSFORM(WINED3D_TS_PROJECTION)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 70f07a1..98df60c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2814,8 +2814,6 @@ void transform_texture(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; void state_ambient(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; -void viewport_vertexpart(struct wined3d_context *context, - const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; void state_clipping(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; void light(struct wined3d_context *context,