mesa: Clean up nomenclature for pipeline stages.
authorPaul Berry <stereotype441@gmail.com>
Tue, 7 Jan 2014 18:11:39 +0000 (10:11 -0800)
committerPaul Berry <stereotype441@gmail.com>
Wed, 8 Jan 2014 15:30:30 +0000 (07:30 -0800)
commit665b8d7b6d8eae03c9dc0ef1a744fe59d9cc6cb6
tree54e3ca4a5dded5d90e29a5a541c9ed190352f3e9
parenteda21d2a3010d9fc5a68b55a843c5e44b2abf8dd
mesa: Clean up nomenclature for pipeline stages.

Previously, we had an enum called gl_shader_type which represented
pipeline stages in the order they occur in the pipeline
(i.e. MESA_SHADER_VERTEX=0, MESA_SHADER_GEOMETRY=1, etc), and several
inconsistently named functions for converting between it and other
representations:

- _mesa_shader_type_to_string: gl_shader_type -> string
- _mesa_shader_type_to_index: GLenum (GL_*_SHADER) -> gl_shader_type
- _mesa_program_target_to_index: GLenum (GL_*_PROGRAM) -> gl_shader_type
- _mesa_shader_enum_to_string: GLenum (GL_*_{SHADER,PROGRAM}) -> string

This patch tries to clean things up so that we use more consistent
terminology: the enum is now called gl_shader_stage (to emphasize that
it is in the order of pipeline stages), and the conversion functions are:

- _mesa_shader_stage_to_string: gl_shader_stage -> string
- _mesa_shader_enum_to_shader_stage: GLenum (GL_*_SHADER) -> gl_shader_stage
- _mesa_program_enum_to_shader_stage: GLenum (GL_*_PROGRAM) -> gl_shader_stage
- _mesa_progshader_enum_to_string: GLenum (GL_*_{SHADER,PROGRAM}) -> string

In addition, MESA_SHADER_TYPES has been renamed to MESA_SHADER_STAGES,
for consistency with the new name for the enum.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Also rename the "target" field of _mesa_glsl_parse_state and the
"target" parameter of _mesa_shader_stage_to_string to "stage".

Reviewed-by: Brian Paul <brianp@vmware.com>
32 files changed:
src/glsl/ast_to_hir.cpp
src/glsl/builtin_functions.cpp
src/glsl/builtin_variables.cpp
src/glsl/glsl_parser.yy
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h
src/glsl/ir_uniform.h
src/glsl/link_atomics.cpp
src/glsl/link_uniform_initializers.cpp
src/glsl/link_uniforms.cpp
src/glsl/link_varyings.cpp
src/glsl/linker.cpp
src/glsl/main.cpp
src/glsl/standalone_scaffolding.cpp
src/glsl/standalone_scaffolding.h
src/glsl/test_optpass.cpp
src/glsl/tests/set_uniform_initializer_tests.cpp
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/main/context.c
src/mesa/main/mtypes.h
src/mesa/main/shaderapi.c
src/mesa/main/shaderapi.h
src/mesa/main/shaderobj.c
src/mesa/main/shaderobj.h
src/mesa/main/uniform_query.cpp
src/mesa/main/uniforms.c
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/program.c
src/mesa/program/program.h
src/mesa/program/sampler.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp