summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
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/mesa/drivers
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/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 78c06fcd680..8d202a2d425 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -463,7 +463,7 @@ brw_initialize_context_constants(struct brw_context *brw)
}
/* We want the GLSL compiler to emit code that uses condition codes */
- for (int i = 0; i < MESA_SHADER_TYPES; i++) {
+ for (int i = 0; i < MESA_SHADER_STAGES; i++) {
ctx->ShaderCompilerOptions[i].MaxIfDepth = brw->gen < 6 ? 16 : UINT_MAX;
ctx->ShaderCompilerOptions[i].EmitCondCodes = true;
ctx->ShaderCompilerOptions[i].EmitNoNoise = true;
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 3f59c804ca5..a40df6d17a4 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -82,7 +82,7 @@ brw_shader_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
static void
brw_lower_packing_builtins(struct brw_context *brw,
- gl_shader_type shader_type,
+ gl_shader_stage shader_type,
exec_list *ir)
{
int ops = LOWER_PACK_SNORM_2x16
@@ -132,7 +132,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
return false;
prog->Parameters = _mesa_new_parameter_list();
- _mesa_copy_linked_program_data((gl_shader_type) stage, shProg, prog);
+ _mesa_copy_linked_program_data((gl_shader_stage) stage, shProg, prog);
void *mem_ctx = ralloc_context(NULL);
bool progress;
@@ -145,7 +145,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
/* lower_packing_builtins() inserts arithmetic instructions, so it
* must precede lower_instructions().
*/
- brw_lower_packing_builtins(brw, (gl_shader_type) stage, shader->ir);
+ brw_lower_packing_builtins(brw, (gl_shader_stage) stage, shader->ir);
do_mat_op_to_vec(shader->ir);
const int bitfield_insert = brw->gen >= 7
? BITFIELD_INSERT_TO_BFM_BFI
@@ -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_shader_enum_to_string(shader->base.Type), shProg->Name);
+ _mesa_progshader_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_shader_enum_to_string(sh->Type),
+ _mesa_progshader_enum_to_string(sh->Type),
i,
shProg->Name);
printf("%s", sh->Source);