[PATCH 1/5] wined3d: Use a separate STATE_VIEWPORT state handler in the GLSL pipeline.
Matteo Bruni
mbruni at codeweavers.com
Fri Mar 20 07:50:52 CDT 2015
This series is based on top of patch 110098 so it should apply fine
after that is merged in.
---
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 e38cd18..3e3f9c2 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -7092,6 +7092,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 },
@@ -7142,7 +7153,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 2d62846..d8fc453 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,
--
2.0.5
More information about the wine-patches
mailing list