Stefan Dösinger : wined3d: Make the stream source application a regular state function.
Alexandre Julliard
julliard at winehq.org
Tue Jul 8 06:10:50 CDT 2008
Module: wine
Branch: master
Commit: 6675374dda76c7bf1b2c9eb603bf39177d79ea9d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6675374dda76c7bf1b2c9eb603bf39177d79ea9d
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Jul 2 09:33:24 2008 -0500
wined3d: Make the stream source application a regular state function.
---
dlls/wined3d/state.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 4e0f5d8..c8bbc14 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3381,11 +3381,19 @@ static inline void drawPrimitiveTraceDataLocations(
return;
}
-/* Helper for vertexdeclaration() */
-static inline void handleStreams(IWineD3DStateBlockImpl *stateblock, BOOL useVertexShaderFunction, WineD3DContext *context) {
+static void handleStreams(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
BOOL fixup = FALSE;
WineDirect3DVertexStridedData *dataLocations = &device->strided_streams;
+ BOOL useVertexShaderFunction;
+
+ if (device->vs_selected_mode != SHADER_NONE && stateblock->vertexShader &&
+ ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.function != NULL) {
+ useVertexShaderFunction = TRUE;
+ } else {
+ useVertexShaderFunction = FALSE;
+ }
+
if(device->up_strided) {
/* Note: this is a ddraw fixed-function code path */
@@ -3470,11 +3478,12 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
BOOL wasrhw = context->last_was_rhw;
+ handleStreams(state, stateblock, context);
+
/* Shaders can be implemented using ARB_PROGRAM, GLSL, or software -
* here simply check whether a shader was set, or the user disabled shaders
*/
- if (device->vs_selected_mode != SHADER_NONE && stateblock->vertexShader &&
- ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.function != NULL) {
+ if (use_vs(device)) {
useVertexShaderFunction = TRUE;
if(((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.reg_maps.fog != context->last_was_foggy_shader) {
@@ -3484,8 +3493,6 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
updateFog = TRUE;
}
- handleStreams(stateblock, useVertexShaderFunction, context);
-
transformed = device->strided_streams.u.s.position_transformed;
if (transformed) useVertexShaderFunction = FALSE;
More information about the wine-cvs
mailing list