[PATCH] WineD3D: move stream source and vshader to misc and =

Stefan Doesinger stefan at codeweavers.com
Wed Jul 2 10:02:19 CDT 2008


vertex pipeline tables=0A=
=0A=
---=0A=
 dlls/wined3d/directx.c         |    2 +-=0A=
 dlls/wined3d/state.c           |   18 ++++++++++++------=0A=
 dlls/wined3d/wined3d_private.h |    1 +=0A=
 3 files changed, 14 insertions(+), 7 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c=0A=
index 7f77604..c1f68f8 100644=0A=
--- a/dlls/wined3d/directx.c=0A=
+++ b/dlls/wined3d/directx.c=0A=
@@ -3447,7 +3447,7 @@ static HRESULT  WINAPI =
IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,=0A=
     object->shader_backend =3D select_shader_backend(Adapter, =
DeviceType);=0A=
 =0A=
     compile_state_table(object->StateTable, object->multistate_funcs,=0A=
-                        NULL, NULL, misc_state_template,=0A=
+                        ffp_vertexstate_template, NULL, =
misc_state_template,=0A=
                         object->shader_backend->StateTable_remove);=0A=
 =0A=
     /* Prefer the vtable with functions optimized for single =
dirtifyable objects if the shader=0A=
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c=0A=
index c8bbc14..47fb87f 100644=0A=
--- a/dlls/wined3d/state.c=0A=
+++ b/dlls/wined3d/state.c=0A=
@@ -3381,7 +3381,7 @@ static inline void drawPrimitiveTraceDataLocations(=0A=
     return;=0A=
 }=0A=
 =0A=
-static void handleStreams(DWORD state, IWineD3DStateBlockImpl =
*stateblock, WineD3DContext *context) {=0A=
+static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, =
WineD3DContext *context) {=0A=
     IWineD3DDeviceImpl *device =3D stateblock->wineD3DDevice;=0A=
     BOOL fixup =3D FALSE;=0A=
     WineDirect3DVertexStridedData *dataLocations =3D =
&device->strided_streams;=0A=
@@ -3478,8 +3478,6 @@ static void vertexdeclaration(DWORD state, =
IWineD3DStateBlockImpl *stateblock, W=0A=
     IWineD3DDeviceImpl *device =3D stateblock->wineD3DDevice;=0A=
     BOOL wasrhw =3D context->last_was_rhw;=0A=
 =0A=
-    handleStreams(state, stateblock, context);=0A=
-=0A=
     /* Shaders can be implemented using ARB_PROGRAM, GLSL, or software -=0A=
      * here simply check whether a shader was set, or the user disabled =
shaders=0A=
      */=0A=
@@ -4837,10 +4835,10 @@ const struct StateEntry FFPStateTable[] =3D=0A=
     { /*510, WINED3DTS_WORLDMATRIX(254)             */      =
STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(254)),        transform_worldex   =
},=0A=
     { /*511, WINED3DTS_WORLDMATRIX(255)             */      =
STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(255)),        transform_worldex   =
},=0A=
       /* Various Vertex states follow */=0A=
-    { /*   , STATE_STREAMSRC                        */      =
STATE_VDECL,                                        vertexdeclaration   =
},=0A=
+    { /*   , STATE_STREAMSRC                        */      =
STATE_VDECL,                                        NULL                =
},=0A=
     { /*   , STATE_INDEXBUFFER                      */      =
STATE_INDEXBUFFER,                                  indexbuffer         =
},=0A=
-    { /*   , STATE_VDECL                            */      =
STATE_VDECL,                                        vertexdeclaration   =
},=0A=
-    { /*   , STATE_VSHADER                          */      =
STATE_VDECL,                                        vertexdeclaration   =
},=0A=
+    { /*   , STATE_VDECL                            */      =
STATE_VDECL,                                        NULL                =
},=0A=
+    { /*   , STATE_VSHADER                          */      =
STATE_VDECL,                                        NULL                =
},=0A=
     { /*   , STATE_VIEWPORT                         */      =
STATE_VIEWPORT,                                     viewport            =
},=0A=
     { /*   , STATE_VERTEXSHADERCONSTANT             */      =
STATE_VERTEXSHADERCONSTANT,                         shaderconstant      =
},=0A=
     { /*   , STATE_PIXELSHADERCONSTANT              */      =
STATE_VERTEXSHADERCONSTANT,                         shaderconstant      =
},=0A=
@@ -4904,6 +4902,14 @@ const struct StateEntryTemplate =
misc_state_template[] =3D {=0A=
     { STATE_RENDER(WINED3DRS_DESTBLENDALPHA),             { =
STATE_RENDER(WINED3DRS_ALPHABLENDENABLE),           state_blend         =
}},=0A=
     { STATE_RENDER(WINED3DRS_DESTBLENDALPHA),             { =
STATE_RENDER(WINED3DRS_ALPHABLENDENABLE),           state_blend         =
}},=0A=
     { STATE_RENDER(WINED3DRS_BLENDOPALPHA),               { =
STATE_RENDER(WINED3DRS_ALPHABLENDENABLE),           state_blend         =
}},=0A=
+    { STATE_STREAMSRC,                                    { =
STATE_VDECL,                                        streamsrc           =
}},=0A=
+    { STATE_VDECL,                                        { =
STATE_VDECL,                                        streamsrc           =
}},=0A=
+    {0 /* Terminate */,                                   { 0,          =
                                        0                   }},=0A=
+};=0A=
+=0A=
+const struct StateEntryTemplate ffp_vertexstate_template[] =3D {=0A=
+    { STATE_VDECL,                                        { =
STATE_VDECL,                                        vertexdeclaration   =
}},=0A=
+    { STATE_VSHADER,                                      { =
STATE_VDECL,                                        vertexdeclaration   =
}},=0A=
     {0 /* Terminate */,                                   { 0,          =
                                        0                   }},=0A=
 };=0A=
 =0A=
diff --git a/dlls/wined3d/wined3d_private.h =
b/dlls/wined3d/wined3d_private.h=0A=
index 90f89fe..35b096b 100644=0A=
--- a/dlls/wined3d/wined3d_private.h=0A=
+++ b/dlls/wined3d/wined3d_private.h=0A=
@@ -593,6 +593,7 @@ struct StateEntryTemplate=0A=
 };=0A=
 =0A=
 extern const struct StateEntryTemplate misc_state_template[];=0A=
+extern const struct StateEntryTemplate ffp_vertexstate_template[];=0A=
 =0A=
 /* "Base" state table */=0A=
 extern const struct StateEntry FFPStateTable[];=0A=
-- =0A=
1.5.4.5=0A=
=0A=

------=_NextPart_000_0051_01C8E026.90A54B30--




More information about the wine-patches mailing list