diff options
author | Paul Berry <stereotype441@gmail.com> | 2014-01-07 10:11:39 -0800 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2014-01-08 07:30:30 -0800 |
commit | 665b8d7b6d8eae03c9dc0ef1a744fe59d9cc6cb6 (patch) | |
tree | 54e3ca4a5dded5d90e29a5a541c9ed190352f3e9 /src/glsl/standalone_scaffolding.h | |
parent | eda21d2a3010d9fc5a68b55a843c5e44b2abf8dd (diff) | |
download | external_mesa3d-665b8d7b6d8eae03c9dc0ef1a744fe59d9cc6cb6.zip external_mesa3d-665b8d7b6d8eae03c9dc0ef1a744fe59d9cc6cb6.tar.gz external_mesa3d-665b8d7b6d8eae03c9dc0ef1a744fe59d9cc6cb6.tar.bz2 |
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>
Diffstat (limited to 'src/glsl/standalone_scaffolding.h')
-rw-r--r-- | src/glsl/standalone_scaffolding.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/standalone_scaffolding.h b/src/glsl/standalone_scaffolding.h index 9f4818a..327fef2 100644 --- a/src/glsl/standalone_scaffolding.h +++ b/src/glsl/standalone_scaffolding.h @@ -48,8 +48,8 @@ extern "C" void _mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id, const char *msg, int len); -static inline gl_shader_type -_mesa_shader_type_to_index(GLenum v) +static inline gl_shader_stage +_mesa_shader_enum_to_shader_stage(GLenum v) { switch (v) { case GL_VERTEX_SHADER: @@ -59,7 +59,7 @@ _mesa_shader_type_to_index(GLenum v) case GL_GEOMETRY_SHADER: return MESA_SHADER_GEOMETRY; default: - assert(!"bad value in _mesa_shader_type_to_index()"); + assert(!"bad value in _mesa_shader_enum_to_shader_stage()"); return MESA_SHADER_VERTEX; } } |