[PATCH] WineD3D: Make the stream source application a regular =

Stefan Doesinger stefan at codeweavers.com
Wed Jul 2 09:33:24 CDT 2008

state function=0A=
This does not untie the states from each other, but it makes it easier =
to put=0A=
them into different pipeline parts=0A=
 dlls/wined3d/state.c |   19 +++++++++++++------=0A=
 1 files changed, 13 insertions(+), 6 deletions(-)=0A=
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c=0A=
index 4e0f5d8..c8bbc14 100644=0A=
--- a/dlls/wined3d/state.c=0A=
+++ b/dlls/wined3d/state.c=0A=
@@ -3381,11 +3381,19 @@ static inline void =
-/* Helper for vertexdeclaration() */=0A=
-static inline void handleStreams(IWineD3DStateBlockImpl *stateblock, =
BOOL useVertexShaderFunction, WineD3DContext *context) {=0A=
+static void handleStreams(DWORD state, IWineD3DStateBlockImpl =
*stateblock, WineD3DContext *context) {=0A=
     IWineD3DDeviceImpl *device =3D stateblock->wineD3DDevice;=0A=
     BOOL fixup =3D FALSE;=0A=
     WineDirect3DVertexStridedData *dataLocations =3D =
+    BOOL useVertexShaderFunction;=0A=
+    if (device->vs_selected_mode !=3D SHADER_NONE && =
stateblock->vertexShader &&=0A=
+        ((IWineD3DVertexShaderImpl =
*)stateblock->vertexShader)->baseShader.function !=3D NULL) {=0A=
+        useVertexShaderFunction =3D TRUE;=0A=
+    } else {=0A=
+        useVertexShaderFunction =3D FALSE;=0A=
+    }=0A=
     if(device->up_strided) {=0A=
         /* Note: this is a ddraw fixed-function code path */=0A=
@@ -3470,11 +3478,12 @@ static void vertexdeclaration(DWORD state, =
IWineD3DStateBlockImpl *stateblock, W=0A=
     IWineD3DDeviceImpl *device =3D stateblock->wineD3DDevice;=0A=
     BOOL wasrhw =3D context->last_was_rhw;=0A=
+    handleStreams(state, stateblock, context);=0A=
     /* Shaders can be implemented using ARB_PROGRAM, GLSL, or software -=0A=
      * here simply check whether a shader was set, or the user disabled =
-    if (device->vs_selected_mode !=3D SHADER_NONE && =
stateblock->vertexShader &&=0A=
-       ((IWineD3DVertexShaderImpl =
*)stateblock->vertexShader)->baseShader.function !=3D NULL) {=0A=
+    if (use_vs(device)) {=0A=
         useVertexShaderFunction =3D TRUE;=0A=
         if(((IWineD3DVertexShaderImpl =
*)stateblock->vertexShader)->baseShader.reg_maps.fog !=3D =
context->last_was_foggy_shader) {=0A=
@@ -3484,8 +3493,6 @@ static void vertexdeclaration(DWORD state, =
IWineD3DStateBlockImpl *stateblock, W=0A=
         updateFog =3D TRUE;=0A=
-    handleStreams(stateblock, useVertexShaderFunction, context);=0A=
     transformed =3D device->strided_streams.u.s.position_transformed;=0A=
     if (transformed) useVertexShaderFunction =3D FALSE;=0A=
-- =0A=


More information about the wine-patches mailing list