diff options
author | Paul Berry <[email protected]> | 2013-12-17 12:13:11 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-12-30 11:21:08 -0800 |
commit | 26707abe5635e99814603a0f4895865e977cf267 (patch) | |
tree | be2b80723c8fef82c7cb50f0f290ee3927eb79b5 /src/glsl/ast_to_hir.cpp | |
parent | f425d56ba41382be04366d011536ee78a03a2f33 (diff) |
Rename overloads of _mesa_glsl_shader_target_name().
Previously, _mesa_glsl_shader_target_name() had an overload for GLenum
and an overload for the gl_shader_type enum, each of which behaved
differently. However, since GLenum is a synonym for unsigned int, and
unsigned ints are often used in place of gl_shader_type (e.g. in loop
indices), there was a big risk of calling the wrong overload by
mistake. This patch gives the two overloads different names so that
it's always clear which one we mean to call.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 3bc181e8785..91810f985bf 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2110,7 +2110,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "%s cannot be given an explicit location in %s shader", mode_string(var), - _mesa_glsl_shader_target_name(state->target)); + _mesa_shader_type_to_string(state->target)); } else { var->data.explicit_location = true; @@ -2188,7 +2188,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "`attribute' variables may not be declared in the " "%s shader", - _mesa_glsl_shader_target_name(state->target)); + _mesa_shader_type_to_string(state->target)); } /* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says: @@ -2599,7 +2599,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, if ((var->data.mode == ir_var_shader_in) && (state->current_function == NULL)) { _mesa_glsl_error(& initializer_loc, state, "cannot initialize %s shader input / %s", - _mesa_glsl_shader_target_name(state->target), + _mesa_shader_type_to_string(state->target), (state->target == MESA_SHADER_VERTEX) ? "attribute" : "varying"); } @@ -4890,7 +4890,7 @@ ast_interface_block::hir(exec_list *instructions, _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex input not allowed " "in the %s shader", - _mesa_glsl_shader_target_name(state->target)); + _mesa_shader_type_to_string(state->target)); } if (this->instance_name == NULL || strcmp(this->instance_name, "gl_in") != 0 || !this->is_array) { @@ -4907,7 +4907,7 @@ ast_interface_block::hir(exec_list *instructions, _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex output not " "allowed in the %s shader", - _mesa_glsl_shader_target_name(state->target)); + _mesa_shader_type_to_string(state->target)); } if (this->instance_name != NULL) { _mesa_glsl_error(&loc, state, |