diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 3bcb71b2068..3bc7224c818 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -932,7 +932,7 @@ static void shader_arb_get_register_name(const struct wined3d_shader_instruction { /* oPos, oFog and oPts in D3D */ static const char * const rastout_reg_names[] = {"TMP_OUT", "result.fogcoord", "result.pointsize"}; - IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps; BOOL pshader = shader_is_pshader_version(reg_maps->shader_version.type); struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data; @@ -1034,7 +1034,7 @@ static void shader_arb_get_register_name(const struct wined3d_shader_instruction case WINED3DSPR_CONST: if (!pshader && reg->rel_addr) { - const struct arb_vshader_private *shader_data = This->baseShader.backend_data; + const struct arb_vshader_private *shader_data = shader->baseShader.backend_data; UINT rel_offset = shader_data->rel_offset; BOOL aL = FALSE; char rel_reg[50]; @@ -1328,8 +1328,8 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD IWineD3DBaseTextureImpl *texture; const char *tex_type; BOOL np2_fixup = FALSE; - IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; - IWineD3DDeviceImpl *device = This->baseShader.device; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; + IWineD3DDeviceImpl *device = shader->baseShader.device; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; const char *mod; BOOL pshader = shader_is_pshader_version(ins->ctx->reg_maps->shader_version.type); @@ -1744,7 +1744,7 @@ static void shader_hw_nop(const struct wined3d_shader_instruction *ins) static void shader_hw_mov(const struct wined3d_shader_instruction *ins) { - IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps; BOOL pshader = shader_is_pshader_version(reg_maps->shader_version.type); struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data; @@ -3193,7 +3193,7 @@ static void shader_hw_ret(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; - IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *) ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); if(priv->target_version == ARB) return; @@ -5231,7 +5231,7 @@ static void free_recorded_instruction(struct list *list) static void shader_arb_handle_instruction(const struct wined3d_shader_instruction *ins) { SHADER_HANDLER hw_fct; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; - IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; struct control_frame *control_frame; struct wined3d_shader_buffer *buffer = ins->ctx->buffer; BOOL bool_const; @@ -5262,7 +5262,7 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio list_init(&priv->record); priv->recording = TRUE; control_frame->outer_loop = TRUE; - get_loop_control_const(ins, This, ins->src[0].reg.idx, &control_frame->loop_control); + get_loop_control_const(ins, shader, ins->src[0].reg.idx, &control_frame->loop_control); return; /* Instruction is handled */ } /* Record this loop in the outer loop's recording */ @@ -5359,7 +5359,7 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio list_add_head(&priv->control_frames, &control_frame->entry); control_frame->type = IF; - bool_const = get_bool_const(ins, This, ins->src[0].reg.idx); + bool_const = get_bool_const(ins, shader, ins->src[0].reg.idx); if(ins->src[0].modifiers == WINED3DSPSM_NOT) bool_const = !bool_const; if (!priv->muted && !bool_const) { diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 45d098b3673..6b0cce5e0dc 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1307,7 +1307,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * /* oPos, oFog and oPts in D3D */ static const char * const hwrastout_reg_names[] = {"OUT[10]", "OUT[11].x", "OUT[11].y"}; - IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps; const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; char pshader = shader_is_pshader_version(reg_maps->shader_version.type); @@ -1333,7 +1333,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * /* pixel shaders >= 3.0 */ if (reg_maps->shader_version.major >= 3) { - DWORD idx = ((IWineD3DPixelShaderImpl *)This)->input_reg_map[reg->idx]; + DWORD idx = ((IWineD3DPixelShaderImpl *)shader)->input_reg_map[reg->idx]; unsigned int in_count = vec4_varyings(reg_maps->shader_version.major, gl_info); if (reg->rel_addr) @@ -1346,7 +1346,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * * operation there */ if (idx) { - if (((IWineD3DPixelShaderImpl *)This)->declared_in_count > in_count) + if (((IWineD3DPixelShaderImpl *)shader)->declared_in_count > in_count) { sprintf(register_name, "((%s + %u) > %d ? (%s + %u) > %d ? gl_SecondaryColor : gl_Color : IN[%s + %u])", @@ -1360,7 +1360,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * } else { - if (((IWineD3DPixelShaderImpl *)This)->declared_in_count > in_count) + if (((IWineD3DPixelShaderImpl *)shader)->declared_in_count > in_count) { sprintf(register_name, "((%s) > %d ? (%s) > %d ? gl_SecondaryColor : gl_Color : IN[%s])", rel_param.param_str, in_count - 1, rel_param.param_str, in_count, @@ -1401,7 +1401,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * } else { - if (shader_constant_is_local(This, reg->idx)) + if (shader_constant_is_local(shader, reg->idx)) sprintf(register_name, "%cLC%u", prefix, reg->idx); else sprintf(register_name, "%cC[%u]", prefix, reg->idx); @@ -2830,7 +2830,7 @@ static void shader_glsl_loop(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_loop_state *loop_state = ins->ctx->loop_state; glsl_src_param_t src1_param; - IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; const DWORD *control_values = NULL; const local_constant *constant; @@ -2912,7 +2912,7 @@ static void shader_glsl_end(const struct wined3d_shader_instruction *ins) static void shader_glsl_rep(const struct wined3d_shader_instruction *ins) { - IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; struct wined3d_shader_loop_state *loop_state = ins->ctx->loop_state; glsl_src_param_t src0_param; const DWORD *control_values = NULL; @@ -3022,7 +3022,7 @@ static void shader_glsl_ret(const struct wined3d_shader_instruction *ins) ********************************************/ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins) { - IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; IWineD3DDeviceImpl *device = shader->baseShader.device; DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, ins->ctx->reg_maps->shader_version.minor); @@ -3112,8 +3112,8 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins) static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins) { - IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; - IWineD3DDeviceImpl *device = This->baseShader.device; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; + IWineD3DDeviceImpl *device = shader->baseShader.device; const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; glsl_sample_function_t sample_function; glsl_src_param_t coord_param, dx_param, dy_param; @@ -3145,8 +3145,8 @@ static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins) static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins) { - IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; - IWineD3DDeviceImpl *device = This->baseShader.device; + struct IWineD3DBaseShaderImpl *shader = ins->ctx->shader; + IWineD3DDeviceImpl *device = shader->baseShader.device; const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; glsl_sample_function_t sample_function; glsl_src_param_t coord_param, lod_param; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index ef25a0cbb2b..97b3e643219 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1185,7 +1185,7 @@ void shader_generate_main(IWineD3DBaseShaderImpl *shader, struct wined3d_shader_ loop_state.current_depth = 0; loop_state.current_reg = 0; - ctx.shader = (IWineD3DBaseShader *)shader; + ctx.shader = shader; ctx.gl_info = &device->adapter->gl_info; ctx.reg_maps = reg_maps; ctx.buffer = buffer; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6f30716c31e..e0749a7db37 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -588,7 +588,7 @@ struct wined3d_shader_loop_state struct wined3d_shader_context { - IWineD3DBaseShader *shader; + struct IWineD3DBaseShaderImpl *shader; const struct wined3d_gl_info *gl_info; const struct wined3d_shader_reg_maps *reg_maps; struct wined3d_shader_buffer *buffer;