[PATCH 2/4] wined3d: Pass a wined3d_state structure to find_ps_compile_args().
Henri Verbeet
hverbeet at codeweavers.com
Wed Sep 29 05:20:45 CDT 2010
---
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/glsl_shader.c | 2 +-
dlls/wined3d/shader.c | 7 +++----
dlls/wined3d/wined3d_private.h | 4 ++--
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 5f76a45..b4c2a3b 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -4398,7 +4398,7 @@ static inline void find_arb_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWi
const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info;
const struct wined3d_state *state = &stateblock->state;
- find_ps_compile_args(shader, stateblock, &args->super);
+ find_ps_compile_args(state, shader, &args->super);
/* This forces all local boolean constants to 1 to make them stateblock independent */
args->bools = shader->baseShader.reg_maps.local_bool_consts;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index f640fa4..28a3350 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -4293,7 +4293,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context,
struct vs_compile_args 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);
+ if (pshader) find_ps_compile_args(state, (IWineD3DPixelShaderImpl *)pshader, &ps_compile_args);
entry = get_glsl_program_entry(priv, vshader, pshader, &vs_compile_args, &ps_compile_args);
if (entry) {
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 08c211e..3bbf5ed 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2067,12 +2067,11 @@ static const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl =
pixelshader_GetFunction
};
-void find_ps_compile_args(IWineD3DPixelShaderImpl *shader,
- IWineD3DStateBlockImpl *stateblock, struct ps_compile_args *args)
+void find_ps_compile_args(const struct wined3d_state *state,
+ IWineD3DPixelShaderImpl *shader, struct ps_compile_args *args)
{
- const struct wined3d_state *state = &stateblock->state;
+ IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)shader->baseShader.device;
IWineD3DBaseTextureImpl *texture;
- IWineD3DDeviceImpl *device = stateblock->device;
UINT i;
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2ce1904..1ab89c5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2915,8 +2915,8 @@ HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *de
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
void pixelshader_update_samplers(struct shader_reg_maps *reg_maps,
IWineD3DBaseTexture * const *textures) DECLSPEC_HIDDEN;
-void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImpl *stateblock,
- struct ps_compile_args *args) DECLSPEC_HIDDEN;
+void find_ps_compile_args(const struct wined3d_state *state,
+ IWineD3DPixelShaderImpl *shader, struct ps_compile_args *args) DECLSPEC_HIDDEN;
/* sRGB correction constants */
static const float srgb_cmp = 0.0031308f;
--
1.7.2.2
More information about the wine-patches
mailing list