[10/16] WineD3D: Add a viewport state to the state table

Stefan Dösinger stefandoesinger at gmx.at
Mon Jan 1 18:30:00 CST 2007


Am 02.01.2007 um 01:20 schrieb Stefan Dösinger:

> Right now grouped with the vertex declaration block because matrix  
> handling will be done under the umbrella of the vdecl in the  
> beginning. Right now the viewport is still set in SetViewport, this  
> will be a seperate patch. The aim for this here is to update the  
> projection matrix on a vp change.
>
Use this patch instead, I accidentally pressed send and sent an old  
version of the patch which didn't add the state line
-------------- next part --------------
From ce3d77c1d794489472038416ae823b71c0001488 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Stefan_D=C3=B6singer?= <stefan at imac.local>
Date: Tue, 2 Jan 2007 01:17:20 +0100
Subject: [PATCH] WineD3D: Add a viewport state to the state table

---
 dlls/wined3d/device.c          |    2 ++
 dlls/wined3d/state.c           |    2 +-
 dlls/wined3d/wined3d_private.h |    5 ++++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b3984c0..ec79793 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3064,6 +3064,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl
 
     LEAVE_GL();
 
+    /* Todo: move the gl code too */
+    IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VIEWPORT);
     return WINED3D_OK;
 
 }
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 2b32b42..89701b4 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -2909,5 +2909,5 @@ const struct StateEntry StateTable[] =
     { /*   , STATE_STREAMSRC                        */      STATE_VDECL,                                        vertexdeclaration   },
     { /*   , STATE_VDECL                            */      STATE_VDECL,                                        vertexdeclaration   },
     { /*   , STATE_VSHADER                          */      STATE_VDECL,                                        vertexdeclaration   },
-	
+	{ /*   , STATE_VIEWPORT                         */      STATE_VDECL,                                        vertexdeclaration   },
 };
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 542b496..119f053 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -433,7 +433,10 @@ #define STATE_IS_VDECL(a) ((a) == STATE_
 #define STATE_VSHADER (STATE_VDECL + 1)
 #define STATE_IS_VSHADER(a) ((a) == STATE_VSHADER)
 
-#define STATE_HIGHEST (STATE_VSHADER)
+#define STATE_VIEWPORT (STATE_VSHADER + 1)
+#define STATE_IS_VIEWPORT(a) ((a) == STATE_VIEWPORT)
+
+#define STATE_HIGHEST (STATE_VIEWPORT)
 
 struct StateEntry
 {
-- 
1.4.2.4

-------------- next part --------------



More information about the wine-patches mailing list