summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-07 10:11:39 -0800
committerPaul Berry <[email protected]>2014-01-08 07:30:30 -0800
commit665b8d7b6d8eae03c9dc0ef1a744fe59d9cc6cb6 (patch)
tree54e3ca4a5dded5d90e29a5a541c9ed190352f3e9 /src/glsl/link_uniforms.cpp
parenteda21d2a3010d9fc5a68b55a843c5e44b2abf8dd (diff)
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 <[email protected]> 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 <[email protected]>
Diffstat (limited to 'src/glsl/link_uniforms.cpp')
-rw-r--r--src/glsl/link_uniforms.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index bda6e4ffb3b..1c97e195781 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -356,9 +356,9 @@ public:
{
}
- void start_shader(gl_shader_type shader_type)
+ void start_shader(gl_shader_stage shader_type)
{
- assert(shader_type < MESA_SHADER_TYPES);
+ assert(shader_type < MESA_SHADER_STAGES);
this->shader_type = shader_type;
this->shader_samplers_used = 0;
@@ -429,7 +429,7 @@ public:
int ubo_block_index;
int ubo_byte_offset;
bool ubo_row_major;
- gl_shader_type shader_type;
+ gl_shader_stage shader_type;
private:
void handle_samplers(const glsl_type *base_type,
@@ -741,7 +741,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog)
* glGetUniformLocation.
*/
count_uniform_size uniform_size(prog->UniformHash);
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
struct gl_shader *sh = prog->_LinkedShaders[i];
if (sh == NULL)
@@ -809,11 +809,11 @@ link_assign_uniform_locations(struct gl_shader_program *prog)
parcel_out_uniform_storage parcel(prog->UniformHash, uniforms, data);
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
if (prog->_LinkedShaders[i] == NULL)
continue;
- parcel.start_shader((gl_shader_type)i);
+ parcel.start_shader((gl_shader_stage)i);
foreach_list(node, prog->_LinkedShaders[i]->ir) {
ir_variable *const var = ((ir_instruction *) node)->as_variable();