Module: wine Branch: master Commit: 5f0d6afcd7b27b6af381d8c99ab9cb692933d09c URL: https://gitlab.winehq.org/wine/wine/-/commit/5f0d6afcd7b27b6af381d8c99ab9cb6...
Author: Matteo Bruni mbruni@codeweavers.com Date: Thu Jul 13 21:31:37 2023 +0200
wined3d: Don't skip FFP projection transform update.
In the same vein as e106bbdd39a5f27bce028ed992033eb0a5635f60.
---
dlls/wined3d/ffp_gl.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/ffp_gl.c b/dlls/wined3d/ffp_gl.c index 8a87248de4f..e4c44f77609 100644 --- a/dlls/wined3d/ffp_gl.c +++ b/dlls/wined3d/ffp_gl.c @@ -3528,6 +3528,8 @@ static void transform_projection(struct wined3d_context *context, const struct w const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info; struct wined3d_matrix projection;
+ TRACE("context %p, state %p, state_id %lu.\n", context, state, state_id); + gl_info->gl_ops.gl.p_glMatrixMode(GL_PROJECTION); checkGLcall("glMatrixMode(GL_PROJECTION)");
@@ -3558,6 +3560,8 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine BOOL wasrhw = context->last_was_rhw; unsigned int i;
+ TRACE("context %p, state %p, state_id %lu.\n", context, state, state_id); + transformed = context->stream_info.position_transformed; if (transformed != context->last_was_rhw && !useVertexShaderFunction) updateFog = TRUE; @@ -3574,25 +3578,12 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine * make sure they're properly set. */ if (!useVertexShaderFunction) { - /* TODO: Move this mainly to the viewport state and only apply when - * the vp has changed or transformed / untransformed was switched. */ if (wasrhw != context->last_was_rhw - && !isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_PROJECTION)) && !isStateDirty(context, STATE_VIEWPORT)) transform_projection(context, state, STATE_TRANSFORM(WINED3D_TS_PROJECTION)); - /* World matrix needs reapplication here only if we're switching between rhw and non-rhw - * mode. - * - * If a vertex shader is used, the world matrix changed and then vertex shader unbound - * this check will fail and the matrix not applied again. This is OK because a simple - * world matrix change reapplies the matrix - These checks here are only to satisfy the - * needs of the vertex declaration. - * - * World and view matrix go into the same gl matrix, so only apply them when neither is - * dirty - */ - if (transformed != wasrhw && !isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0))) - && !isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_VIEW))) + /* World matrix needs reapplication here only if we're switching + * between rhw and non-rhw mode. */ + if (transformed != wasrhw) transform_world(context, state, STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0))); if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_COLORVERTEX))) context_apply_state(context, state, STATE_RENDER(WINED3D_RS_COLORVERTEX)); @@ -3830,8 +3821,9 @@ static void viewport_miscpart_cc(struct wined3d_context *context,
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)); + TRACE("context %p, state %p, state_id %lu.\n", context, state, state_id); + + transform_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));