wined3d: Pass a wined3d_state structure to find_vs_compile_args().

This commit is contained in:
Henri Verbeet 2010-09-29 12:20:44 +02:00 committed by Alexandre Julliard
parent c2224ea8bb
commit 8d5a25bbec
4 changed files with 12 additions and 11 deletions

View File

@ -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))

View File

@ -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);

View File

@ -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;
}

View File

@ -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;