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 <kenneth@whitecape.org>

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 <brianp@vmware.com>
This commit is contained in:
Paul Berry
2014-01-07 10:11:39 -08:00
parent eda21d2a30
commit 665b8d7b6d
32 changed files with 203 additions and 203 deletions

View File

@@ -82,10 +82,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
linker_error(prog,
"%s shader output `%s' declared as type `%s', "
"but %s shader input declared as type `%s'\n",
_mesa_shader_enum_to_string(producer_type),
_mesa_progshader_enum_to_string(producer_type),
output->name,
output->type->name,
_mesa_shader_enum_to_string(consumer_type),
_mesa_progshader_enum_to_string(consumer_type),
input->type->name);
return;
}
@@ -97,10 +97,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
linker_error(prog,
"%s shader output `%s' %s centroid qualifier, "
"but %s shader input %s centroid qualifier\n",
_mesa_shader_enum_to_string(producer_type),
_mesa_progshader_enum_to_string(producer_type),
output->name,
(output->data.centroid) ? "has" : "lacks",
_mesa_shader_enum_to_string(consumer_type),
_mesa_progshader_enum_to_string(consumer_type),
(input->data.centroid) ? "has" : "lacks");
return;
}
@@ -109,10 +109,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
linker_error(prog,
"%s shader output `%s' %s sample qualifier, "
"but %s shader input %s sample qualifier\n",
_mesa_shader_enum_to_string(producer_type),
_mesa_progshader_enum_to_string(producer_type),
output->name,
(output->data.sample) ? "has" : "lacks",
_mesa_shader_enum_to_string(consumer_type),
_mesa_progshader_enum_to_string(consumer_type),
(input->data.sample) ? "has" : "lacks");
return;
}
@@ -121,10 +121,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
linker_error(prog,
"%s shader output `%s' %s invariant qualifier, "
"but %s shader input %s invariant qualifier\n",
_mesa_shader_enum_to_string(producer_type),
_mesa_progshader_enum_to_string(producer_type),
output->name,
(output->data.invariant) ? "has" : "lacks",
_mesa_shader_enum_to_string(consumer_type),
_mesa_progshader_enum_to_string(consumer_type),
(input->data.invariant) ? "has" : "lacks");
return;
}
@@ -135,10 +135,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
"interpolation qualifier, "
"but %s shader input specifies %s "
"interpolation qualifier\n",
_mesa_shader_enum_to_string(producer_type),
_mesa_progshader_enum_to_string(producer_type),
output->name,
interpolation_string(output->data.interpolation),
_mesa_shader_enum_to_string(consumer_type),
_mesa_progshader_enum_to_string(consumer_type),
interpolation_string(input->data.interpolation));
return;
}
@@ -1217,9 +1217,9 @@ assign_varying_locations(struct gl_context *ctx,
linker_error(prog, "%s shader varying %s not written "
"by %s shader\n.",
_mesa_shader_enum_to_string(consumer->Type),
_mesa_progshader_enum_to_string(consumer->Type),
var->name,
_mesa_shader_enum_to_string(producer->Type));
_mesa_progshader_enum_to_string(producer->Type));
}
/* An 'in' variable is only really a shader input if its