mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an array.
authorPaul Berry <stereotype441@gmail.com>
Thu, 9 Jan 2014 19:16:27 +0000 (11:16 -0800)
committerPaul Berry <stereotype441@gmail.com>
Wed, 22 Jan 2014 04:25:02 +0000 (20:25 -0800)
commit3b22146dc714b6090f7423abbc4df53d7d1fdaa9
treeb59bef08624870671092f9906585869f6f9aeac9
parentcd18ba1c7aba66f2dd7cdbe2cf3b4a803c241d10
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 <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
28 files changed:
src/mesa/drivers/common/meta.c
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_gs_surface_state.c
src/mesa/drivers/dri/i965/brw_vec4_gs.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_vs_state.c
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/i965/brw_wm_state.c
src/mesa/drivers/dri/i965/gen6_sol.c
src/mesa/drivers/dri/i965/gen6_vs_state.c
src/mesa/drivers/dri/i965/gen6_wm_state.c
src/mesa/drivers/dri/i965/gen7_sol_state.c
src/mesa/drivers/dri/i965/gen7_vs_state.c
src/mesa/drivers/dri/i965/gen7_wm_state.c
src/mesa/main/api_validate.c
src/mesa/main/context.c
src/mesa/main/ff_fragment_shader.cpp
src/mesa/main/mtypes.h
src/mesa/main/shaderapi.c
src/mesa/main/state.c
src/mesa/main/texstate.c
src/mesa/main/transformfeedback.c
src/mesa/state_tracker/st_atom_clip.c
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_program.c
src/mesa/swrast/s_fragprog.c