Henri Verbeet : wined3d: Pass a wined3d_state structure to find_vs_compile_args().

Alexandre Julliard julliard at winehq.org
Wed Sep 29 12:00:20 CDT 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Sep 29 12:20:44 2010 +0200

wined3d: Pass a wined3d_state structure to find_vs_compile_args().

---

 dlls/wined3d/arb_program_shader.c |    2 +-
 dlls/wined3d/glsl_shader.c        |    7 ++++---
 dlls/wined3d/shader.c             |   10 +++++-----
 dlls/wined3d/wined3d_private.h    |    4 ++--
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 04be331..5f76a45 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -4454,7 +4454,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
     const struct wined3d_gl_info *gl_info = &dev->adapter->gl_info;
     const struct wined3d_state *state = &stateblock->state;
 
-    find_vs_compile_args(shader, stateblock, &args->super);
+    find_vs_compile_args(state, shader, &args->super);
 
     args->clip.boolclip_compare = 0;
     if (use_ps(state))
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index a731d78..f640fa4 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -4279,8 +4279,9 @@ static GLhandleARB find_glsl_vshader(const struct wined3d_context *context,
 static void set_glsl_shader_program(const struct wined3d_context *context,
         IWineD3DDeviceImpl *device, BOOL use_ps, BOOL use_vs)
 {
-    IWineD3DVertexShader *vshader = use_vs ? (IWineD3DVertexShader *)device->stateBlock->state.vertex_shader : NULL;
-    IWineD3DPixelShader *pshader = use_ps ? (IWineD3DPixelShader *)device->stateBlock->state.pixel_shader : NULL;
+    const struct wined3d_state *state = &device->stateBlock->state;
+    IWineD3DVertexShader *vshader = use_vs ? (IWineD3DVertexShader *)state->vertex_shader : NULL;
+    IWineD3DPixelShader *pshader = use_ps ? (IWineD3DPixelShader *)state->pixel_shader : NULL;
     const struct wined3d_gl_info *gl_info = context->gl_info;
     struct shader_glsl_priv *priv = device->shader_priv;
     struct glsl_shader_prog_link *entry    = NULL;
@@ -4291,7 +4292,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context,
     struct ps_compile_args ps_compile_args;
     struct vs_compile_args vs_compile_args;
 
-    if (vshader) find_vs_compile_args((IWineD3DVertexShaderImpl *)vshader, device->stateBlock, &vs_compile_args);
+    if (vshader) find_vs_compile_args(state, (IWineD3DVertexShaderImpl *)vshader, &vs_compile_args);
     if (pshader) find_ps_compile_args((IWineD3DPixelShaderImpl *)pshader, device->stateBlock, &ps_compile_args);
 
     entry = get_glsl_program_entry(priv, vshader, pshader, &vs_compile_args, &ps_compile_args);
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 8d380b7..08c211e 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -1706,13 +1706,13 @@ static const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl =
     vertexshader_SetLocalConstantsF,
 };
 
-void find_vs_compile_args(IWineD3DVertexShaderImpl *shader,
-        IWineD3DStateBlockImpl *stateblock, struct vs_compile_args *args)
+void find_vs_compile_args(const struct wined3d_state *state,
+        IWineD3DVertexShaderImpl *shader, struct vs_compile_args *args)
 {
-    args->fog_src = stateblock->state.render_states[WINED3DRS_FOGTABLEMODE]
+    args->fog_src = state->render_states[WINED3DRS_FOGTABLEMODE]
             == WINED3DFOG_NONE ? VS_FOG_COORD : VS_FOG_Z;
-    args->clip_enabled = stateblock->state.render_states[WINED3DRS_CLIPPING]
-            && stateblock->state.render_states[WINED3DRS_CLIPPLANEENABLE];
+    args->clip_enabled = state->render_states[WINED3DRS_CLIPPING]
+            && state->render_states[WINED3DRS_CLIPPLANEENABLE];
     args->swizzle_map = ((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.swizzle_map;
 }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8adcc35..2ce1904 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2853,8 +2853,8 @@ typedef struct IWineD3DVertexShaderImpl {
     UINT                       rel_offset;
 } IWineD3DVertexShaderImpl;
 
-void find_vs_compile_args(IWineD3DVertexShaderImpl *shader, IWineD3DStateBlockImpl *stateblock,
-        struct vs_compile_args *args) DECLSPEC_HIDDEN;
+void find_vs_compile_args(const struct wined3d_state *state,
+        IWineD3DVertexShaderImpl *shader, struct vs_compile_args *args) DECLSPEC_HIDDEN;
 HRESULT vertexshader_init(IWineD3DVertexShaderImpl *shader, IWineD3DDeviceImpl *device,
         const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
         void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list