Fabian Bieler : wined3d: Remove usesFog flag from IWineD3DVertexShaderImpl.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 23 08:39:12 CDT 2007


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

Author: Fabian Bieler <der.fabe at gmx.net>
Date:   Fri Apr 20 21:49:21 2007 +0200

wined3d: Remove usesFog flag from IWineD3DVertexShaderImpl.

---

 dlls/wined3d/state.c           |    4 ++--
 dlls/wined3d/vertexshader.c    |    8 ++------
 dlls/wined3d/wined3d_private.h |    1 -
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index c8a3150..1a0bcdd 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -765,7 +765,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
     }
 
     if (use_vs(stateblock->wineD3DDevice)
-            && ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->usesFog) {
+            && ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.reg_maps.fog) {
         if( stateblock->renderState[WINED3DRS_FOGTABLEMODE] != WINED3DFOG_NONE ) {
             if(!is_ps3) FIXME("Implement table fog for foggy vertex shader\n");
             /* Disable fog */
@@ -3018,7 +3018,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
        ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.function != NULL) {
         useVertexShaderFunction = TRUE;
 
-        if(((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->usesFog != context->last_was_foggy_shader) {
+        if(((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.reg_maps.fog != context->last_was_foggy_shader) {
             updateFog = TRUE;
         }
     } else if(context->last_was_foggy_shader) {
diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c
index f02dcdb..56a4354 100644
--- a/dlls/wined3d/vertexshader.c
+++ b/dlls/wined3d/vertexshader.c
@@ -337,9 +337,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
             vshader_glsl_output_unpack(&buffer, This->semantics_out);
 
         /* If this shader doesn't use fog copy the z coord to the fog coord so that we can use table fog */
-        if (reg_maps->fog)
-            This->usesFog = 1;
-        else
+        if (!reg_maps->fog)
             shader_addline(&buffer, "gl_FogFragCoord = gl_Position.z;\n");
         
         /* Write the final position.
@@ -386,9 +384,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
         shader_generate_main( (IWineD3DBaseShader*) This, &buffer, reg_maps, pFunction);
 
         /* If this shader doesn't use fog copy the z coord to the fog coord so that we can use table fog */
-        if (reg_maps->fog)
-            This->usesFog = 1;
-        else
+        if (!reg_maps->fog)
             shader_addline(&buffer, "MOV result.fogcoord, TMP_OUT.z;\n");
 
         /* Write the final position.
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3de938a..d51e15c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1892,7 +1892,6 @@ typedef struct IWineD3DVertexShaderImpl {
     /* IWineD3DVertexShaderImpl */
     IUnknown                    *parent;
 
-    char                        usesFog;
     DWORD                       usage;
 
     /* Vertex shader input and output semantics */




More information about the wine-cvs mailing list