Stefan Dösinger : wined3d: Apply matrices when switching from transformed vertices to shaders.

Alexandre Julliard julliard at winehq.org
Wed Nov 14 07:30:39 CST 2007


Module: wine
Branch: master
Commit: 0334c1760f98fb9b6609704c736ec51337345422
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0334c1760f98fb9b6609704c736ec51337345422

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Nov 11 21:46:17 2007 +0100

wined3d: Apply matrices when switching from transformed vertices to shaders.

---

 dlls/wined3d/state.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 296c5ce..1a49e24 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3426,6 +3426,19 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
                 FIXME("Clipping not supported with vertex shaders\n");
                 warned = TRUE;
             }
+            if(wasrhw) {
+                /* Apply the transform matrices when switching from rhw drawing to vertex shaders. Vertex
+                 * shaders themselves do not need it it, but the matrices are not reapplied automatically when
+                 * switching back from vertex shaders to fixed function processing. So make sure we leave the
+                 * fixed function vertex processing states back in a sane state before switching to shaders
+                 */
+                if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION))) {
+                    transform_projection(STATE_TRANSFORM(WINED3DTS_PROJECTION), stateblock, context);
+                }
+                if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(0)))) {
+                    transform_world(STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(0)), stateblock, context);
+                }
+            }
         }
     }
 




More information about the wine-cvs mailing list