diff options
author | Eric Anholt <[email protected]> | 2013-06-12 16:57:11 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-06-21 10:04:29 -0700 |
commit | faf3dbad0d30ed36ae6010a90ca2513edb591148 (patch) | |
tree | 77dfcda58e211cb78801cfaee2d3e9e837993979 /src/mesa/drivers/dri/i965/brw_shader.cpp | |
parent | 426ca34b7a2c3b9edfc0189daece8de3aff80627 (diff) |
mesa: Use shared code for converting shader targets to short strings.
We were duplicating this code all over the place, and they all would need
updating for the next set of shader targets.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_shader.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 65df9316506..12986cc403d 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -28,6 +28,7 @@ extern "C" { } #include "brw_fs.h" #include "glsl/ir_optimization.h" +#include "glsl/glsl_parser_extras.h" struct gl_shader * brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type) @@ -112,8 +113,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) struct brw_context *brw = brw_context(ctx); struct intel_context *intel = &brw->intel; unsigned int stage; - static const char *target_strings[] - = { "vertex", "fragment", "geometry" }; for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) { struct brw_shader *shader = @@ -262,8 +261,8 @@ 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", target_strings[stage], - shProg->Name); + printf("GLSL IR for linked %s program %d:\n", + _mesa_glsl_shader_target_name(shader->base.Type), shProg->Name); _mesa_print_ir(shader->base.ir, NULL); printf("\n"); } @@ -276,7 +275,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", - target_strings[_mesa_shader_type_to_index(sh->Type)], + _mesa_glsl_shader_target_name(sh->Type), i, shProg->Name); printf("%s", sh->Source); |