Module: wine Branch: master Commit: 5a26da1d19020713266c57175e967cd04e128f75 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5a26da1d19020713266c57175e...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Jun 23 00:02:35 2011 +0200
wined3d: Make the wined3d_shader_context shader pointer const.
---
dlls/wined3d/arb_program_shader.c | 10 +++++----- dlls/wined3d/glsl_shader.c | 12 ++++++------ dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index ee5bf86..7039841 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -944,7 +944,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"}; - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *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; @@ -1337,10 +1337,10 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; DWORD sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx]; + const struct wined3d_shader *shader = ins->ctx->shader; const struct wined3d_texture *texture; const char *tex_type; BOOL np2_fixup = FALSE; - struct wined3d_shader *shader = ins->ctx->shader; struct wined3d_device *device = shader->device; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; const char *mod; @@ -1742,7 +1742,7 @@ static void shader_hw_nop(const struct wined3d_shader_instruction *ins)
static void shader_hw_mov(const struct wined3d_shader_instruction *ins) { - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *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; @@ -3202,7 +3202,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; - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *shader = ins->ctx->shader; BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
if(priv->target_version == ARB) return; @@ -5257,7 +5257,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; - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *shader = ins->ctx->shader; struct control_frame *control_frame; struct wined3d_shader_buffer *buffer = ins->ctx->buffer; BOOL bool_const; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b2e6c00..6aabca3 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1318,7 +1318,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"};
- struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *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); @@ -2842,8 +2842,8 @@ static void shader_glsl_sgn(const struct wined3d_shader_instruction *ins) static void shader_glsl_loop(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_loop_state *loop_state = ins->ctx->loop_state; + const struct wined3d_shader *shader = ins->ctx->shader; glsl_src_param_t src1_param; - struct wined3d_shader *shader = ins->ctx->shader; const DWORD *control_values = NULL; const local_constant *constant;
@@ -2926,7 +2926,7 @@ static void shader_glsl_end(const struct wined3d_shader_instruction *ins)
static void shader_glsl_rep(const struct wined3d_shader_instruction *ins) { - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *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; @@ -3036,7 +3036,7 @@ static void shader_glsl_ret(const struct wined3d_shader_instruction *ins) ********************************************/ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins) { - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *shader = ins->ctx->shader; struct wined3d_device *device = shader->device; DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, ins->ctx->reg_maps->shader_version.minor); @@ -3126,7 +3126,7 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins) { - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *shader = ins->ctx->shader; struct wined3d_device *device = shader->device; const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; glsl_sample_function_t sample_function; @@ -3159,7 +3159,7 @@ static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins) { - struct wined3d_shader *shader = ins->ctx->shader; + const struct wined3d_shader *shader = ins->ctx->shader; struct wined3d_device *device = shader->device; const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; glsl_sample_function_t sample_function; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c35f51e..ed8ae0d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -583,7 +583,7 @@ struct wined3d_shader_loop_state
struct wined3d_shader_context { - struct wined3d_shader *shader; + const struct wined3d_shader *shader; const struct wined3d_gl_info *gl_info; const struct wined3d_shader_reg_maps *reg_maps; struct wined3d_shader_buffer *buffer;