summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-12-17 12:13:11 -0800
committerPaul Berry <[email protected]>2013-12-30 11:21:08 -0800
commit26707abe5635e99814603a0f4895865e977cf267 (patch)
treebe2b80723c8fef82c7cb50f0f290ee3927eb79b5 /src/mesa
parentf425d56ba41382be04366d011536ee78a03a2f33 (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/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp4
-rw-r--r--src/mesa/main/shaderapi.c6
-rw-r--r--src/mesa/main/uniform_query.cpp2
-rw-r--r--src/mesa/program/ir_to_mesa.cpp2
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 6f0ace8932c..3f59c804ca5 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -261,7 +261,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
if (ctx->Shader.Flags & GLSL_DUMP) {
printf("\n");
printf("GLSL IR for linked %s program %d:\n",
- _mesa_glsl_shader_target_name(shader->base.Type), shProg->Name);
+ _mesa_shader_enum_to_string(shader->base.Type), shProg->Name);
_mesa_print_ir(shader->base.ir, NULL);
printf("\n");
}
@@ -274,7 +274,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
continue;
printf("GLSL %s shader %d source for linked program %d:\n",
- _mesa_glsl_shader_target_name(sh->Type),
+ _mesa_shader_enum_to_string(sh->Type),
i,
shProg->Name);
printf("%s", sh->Source);
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 4f3be68a406..57511e83e43 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -791,7 +791,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
} else {
if (ctx->Shader.Flags & GLSL_DUMP) {
printf("GLSL source for %s shader %d:\n",
- _mesa_glsl_shader_target_name(sh->Type), sh->Name);
+ _mesa_shader_enum_to_string(sh->Type), sh->Name);
printf("%s\n", sh->Source);
}
@@ -823,7 +823,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
if (!sh->CompileStatus) {
if (ctx->Shader.Flags & GLSL_DUMP_ON_ERROR) {
fprintf(stderr, "GLSL source for %s shader %d:\n",
- _mesa_glsl_shader_target_name(sh->Type), sh->Name);
+ _mesa_shader_enum_to_string(sh->Type), sh->Name);
fprintf(stderr, "%s\n", sh->Source);
fprintf(stderr, "Info Log:\n%s\n", sh->InfoLog);
fflush(stderr);
@@ -898,7 +898,7 @@ print_shader_info(const struct gl_shader_program *shProg)
printf("Mesa: glUseProgram(%u)\n", shProg->Name);
for (i = 0; i < shProg->NumShaders; i++) {
printf(" %s shader %u, checksum %u\n",
- _mesa_glsl_shader_target_name(shProg->Shaders[i]->Type),
+ _mesa_shader_enum_to_string(shProg->Shaders[i]->Type),
shProg->Shaders[i]->Name,
shProg->Shaders[i]->SourceChecksum);
}
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 88ad476acb9..61bcbcb8afd 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -452,7 +452,7 @@ log_program_parameters(const struct gl_shader_program *shProg)
const struct gl_program *const prog = shProg->_LinkedShaders[i]->Program;
printf("Program %d %s shader parameters:\n",
- shProg->Name, _mesa_glsl_shader_target_name(prog->Target));
+ shProg->Name, _mesa_shader_enum_to_string(prog->Target));
for (unsigned j = 0; j < prog->Parameters->NumParameters; j++) {
printf("%s: %p %f %f %f %f\n",
prog->Parameters->Parameters[j].Name,
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 23d479c32d6..beb0c093b5e 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2801,7 +2801,7 @@ get_mesa_program(struct gl_context *ctx,
int i;
struct gl_program *prog;
GLenum target;
- const char *target_string = _mesa_glsl_shader_target_name(shader->Type);
+ const char *target_string = _mesa_shader_enum_to_string(shader->Type);
struct gl_shader_compiler_options *options =
&ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)];
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 1331c73dc30..eb12426a544 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5143,7 +5143,7 @@ get_mesa_program(struct gl_context *ctx,
if (ctx->Shader.Flags & GLSL_DUMP) {
printf("\n");
printf("GLSL IR for linked %s program %d:\n",
- _mesa_glsl_shader_target_name(shader->Type),
+ _mesa_shader_enum_to_string(shader->Type),
shader_program->Name);
_mesa_print_ir(shader->ir, NULL);
printf("\n");