diff options
author | Paul Berry <[email protected]> | 2014-01-09 11:16:27 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-01-21 20:25:02 -0800 |
commit | 3b22146dc714b6090f7423abbc4df53d7d1fdaa9 (patch) | |
tree | b59bef08624870671092f9906585869f6f9aeac9 /src/mesa/drivers/dri/i965 | |
parent | cd18ba1c7aba66f2dd7cdbe2cf3b4a803c241d10 (diff) |
mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an array.
These are replaced with
ctx->Shader.CurrentProgram[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}].
In patches to follow, this will allow us to replace a lot of ad-hoc
logic with a variable index into the array.
With the exception of the changes to mtypes.h, this patch was
generated entirely by the command:
find src -type f '(' -iname '*.c' -o -iname '*.cpp' ')' \
-print0 | xargs -0 sed -i \
-e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \
-e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \
-e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g'
Reviewed-by: Chris Forbes <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_gs.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_gs_surface_state.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_gs.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_sol.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_vs_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_wm_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_sol_state.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_vs_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_wm_state.c | 2 |
13 files changed, 19 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 20e2ecb54f3..3e1ed730b60 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -187,7 +187,7 @@ static void populate_key(struct brw_context *brw, /* BRW_NEW_TRANSFORM_FEEDBACK */ if (_mesa_is_xfb_active_and_unpaused(ctx)) { const struct gl_shader_program *shaderprog = - ctx->Shader.CurrentVertexProgram; + ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; const struct gl_transform_feedback_info *linked_xfb_info = &shaderprog->LinkedTransformFeedback; int i; diff --git a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c index 5661941fabd..1ccf2e28ea2 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c @@ -69,7 +69,7 @@ brw_upload_gs_ubo_surfaces(struct brw_context *brw) struct gl_context *ctx = &brw->ctx; /* _NEW_PROGRAM */ - struct gl_shader_program *prog = ctx->Shader.CurrentGeometryProgram; + struct gl_shader_program *prog = ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]; if (!prog) return; @@ -93,7 +93,7 @@ brw_upload_gs_abo_surfaces(struct brw_context *brw) { struct gl_context *ctx = &brw->ctx; /* _NEW_PROGRAM */ - struct gl_shader_program *prog = ctx->Shader.CurrentGeometryProgram; + struct gl_shader_program *prog = ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]; if (prog) { /* CACHE_NEW_GS_PROG */ diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c index c40112b0f1f..80e6f97144a 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_gs.c +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs.c @@ -296,7 +296,7 @@ brw_upload_gs_prog(struct brw_context *brw) if (!brw_search_cache(&brw->cache, BRW_GS_PROG, &key, sizeof(key), &stage_state->prog_offset, &brw->gs.prog_data)) { - bool success = do_gs_prog(brw, ctx->Shader.CurrentGeometryProgram, + bool success = do_gs_prog(brw, ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY], gp, &key); assert(success); } diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 0e9470fe0a3..be260ae1a79 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -156,7 +156,7 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vue_map *vue_map, */ gl_clip_plane *brw_select_clip_planes(struct gl_context *ctx) { - if (ctx->Shader.CurrentVertexProgram) { + if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]) { /* There is currently a GLSL vertex shader, so clip according to GLSL * rules, which means compare gl_ClipVertex (or gl_Position, if * gl_ClipVertex wasn't assigned) against the eye-coordinate clip planes @@ -482,7 +482,7 @@ static void brw_upload_vs_prog(struct brw_context *brw) if (!brw_search_cache(&brw->cache, BRW_VS_PROG, &key, sizeof(key), &brw->vs.base.prog_offset, &brw->vs.prog_data)) { - bool success = do_vs_prog(brw, ctx->Shader.CurrentVertexProgram, + bool success = do_vs_prog(brw, ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX], vp, &key); (void) success; assert(success); diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c index a712aee0a20..e493c3e325e 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_state.c @@ -60,7 +60,7 @@ brw_upload_vs_unit(struct brw_context *brw) /* Use ALT floating point mode for ARB vertex programs, because they * require 0^0 == 1. */ - if (brw->ctx.Shader.CurrentVertexProgram == NULL) + if (brw->ctx.Shader.CurrentProgram[MESA_SHADER_VERTEX] == NULL) vs->thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754; else vs->thread1.floating_point_mode = BRW_FLOATING_POINT_IEEE_754; diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index e3fa6386941..06e246a0abe 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -130,7 +130,7 @@ brw_upload_vs_ubo_surfaces(struct brw_context *brw) { struct gl_context *ctx = &brw->ctx; /* _NEW_PROGRAM */ - struct gl_shader_program *prog = ctx->Shader.CurrentVertexProgram; + struct gl_shader_program *prog = ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; if (!prog) return; @@ -154,7 +154,7 @@ brw_upload_vs_abo_surfaces(struct brw_context *brw) { struct gl_context *ctx = &brw->ctx; /* _NEW_PROGRAM */ - struct gl_shader_program *prog = ctx->Shader.CurrentVertexProgram; + struct gl_shader_program *prog = ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; if (prog) { /* CACHE_NEW_VS_PROG */ diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index d9e04933668..ddd260a72e6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -115,7 +115,7 @@ brw_upload_wm_unit(struct brw_context *brw) * rendering, CurrentFragmentProgram is used for this check to * differentiate between the GLSL and non-GLSL cases. */ - if (ctx->Shader.CurrentFragmentProgram == NULL) + if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] == NULL) wm->thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754; else wm->thread1.floating_point_mode = BRW_FLOATING_POINT_IEEE_754; diff --git a/src/mesa/drivers/dri/i965/gen6_sol.c b/src/mesa/drivers/dri/i965/gen6_sol.c index eede109a285..0047c8aa76e 100644 --- a/src/mesa/drivers/dri/i965/gen6_sol.c +++ b/src/mesa/drivers/dri/i965/gen6_sol.c @@ -43,7 +43,7 @@ gen6_update_sol_surfaces(struct brw_context *brw) ctx->TransformFeedback.CurrentObject; /* BRW_NEW_VERTEX_PROGRAM */ const struct gl_shader_program *shaderprog = - ctx->Shader.CurrentVertexProgram; + ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; const struct gl_transform_feedback_info *linked_xfb_info = &shaderprog->LinkedTransformFeedback; int i; @@ -89,7 +89,7 @@ brw_gs_upload_binding_table(struct brw_context *brw) struct gl_context *ctx = &brw->ctx; /* BRW_NEW_VERTEX_PROGRAM */ const struct gl_shader_program *shaderprog = - ctx->Shader.CurrentVertexProgram; + ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; bool has_surfaces = false; uint32_t *bind; @@ -175,7 +175,7 @@ brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode, { struct brw_context *brw = brw_context(ctx); const struct gl_shader_program *vs_prog = - ctx->Shader.CurrentVertexProgram; + ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; const struct gl_transform_feedback_info *linked_xfb_info = &vs_prog->LinkedTransformFeedback; struct gl_transform_feedback_object *xfb_obj = diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index ac58e9759c2..6c6f73979cb 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -158,7 +158,7 @@ upload_vs_state(struct brw_context *brw) /* Use ALT floating point mode for ARB vertex programs, because they * require 0^0 == 1. */ - if (ctx->Shader.CurrentVertexProgram == NULL) + if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] == NULL) floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT; BEGIN_BATCH(6); diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index 0bb5ef3e751..c29a45c16ef 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -140,7 +140,7 @@ upload_wm_state(struct brw_context *brw) * rendering, CurrentFragmentProgram is used for this check to * differentiate between the GLSL and non-GLSL cases. */ - if (ctx->Shader.CurrentFragmentProgram == NULL) + if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] == NULL) dw2 |= GEN6_WM_FLOATING_POINT_MODE_ALT; /* CACHE_NEW_SAMPLER */ diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c index 8ef899306a0..1ca2b743ccf 100644 --- a/src/mesa/drivers/dri/i965/gen7_sol_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c @@ -41,7 +41,7 @@ upload_3dstate_so_buffers(struct brw_context *brw) struct gl_context *ctx = &brw->ctx; /* BRW_NEW_VERTEX_PROGRAM */ const struct gl_shader_program *vs_prog = - ctx->Shader.CurrentVertexProgram; + ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; const struct gl_transform_feedback_info *linked_xfb_info = &vs_prog->LinkedTransformFeedback; /* BRW_NEW_TRANSFORM_FEEDBACK */ @@ -104,7 +104,7 @@ gen7_upload_3dstate_so_decl_list(struct brw_context *brw, struct gl_context *ctx = &brw->ctx; /* BRW_NEW_VERTEX_PROGRAM */ const struct gl_shader_program *vs_prog = - ctx->Shader.CurrentVertexProgram; + ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]; /* BRW_NEW_TRANSFORM_FEEDBACK */ const struct gl_transform_feedback_info *linked_xfb_info = &vs_prog->LinkedTransformFeedback; diff --git a/src/mesa/drivers/dri/i965/gen7_vs_state.c b/src/mesa/drivers/dri/i965/gen7_vs_state.c index 1e76eb1ee2e..8381e1fa389 100644 --- a/src/mesa/drivers/dri/i965/gen7_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen7_vs_state.c @@ -92,7 +92,7 @@ upload_vs_state(struct brw_context *brw) /* Use ALT floating point mode for ARB vertex programs, because they * require 0^0 == 1. */ - if (ctx->Shader.CurrentVertexProgram == NULL) + if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] == NULL) floating_point_mode = GEN6_VS_FLOATING_POINT_MODE_ALT; BEGIN_BATCH(6); diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c index 8dcefc2e04c..70b63353215 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c @@ -174,7 +174,7 @@ upload_ps_state(struct brw_context *brw) * differentiate between the GLSL and non-GLSL cases. */ /* BRW_NEW_FRAGMENT_PROGRAM */ - if (ctx->Shader.CurrentFragmentProgram == NULL) + if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] == NULL) dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT; /* Haswell requires the sample mask to be set in this packet as well as |