summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_atomics.cpp
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/glsl/link_atomics.cpp
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/glsl/link_atomics.cpp')
-rw-r--r--src/glsl/link_atomics.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp
index 603329c503b..bfa09a3bca6 100644
--- a/src/glsl/link_atomics.cpp
+++ b/src/glsl/link_atomics.cpp
@@ -64,7 +64,7 @@ namespace {
active_atomic_counter *counters;
unsigned num_counters;
- unsigned stage_references[MESA_SHADER_TYPES];
+ unsigned stage_references[MESA_SHADER_STAGES];
unsigned size;
};
@@ -96,7 +96,7 @@ namespace {
*num_buffers = 0;
- for (unsigned i = 0; i < MESA_SHADER_TYPES; ++i) {
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; ++i) {
struct gl_shader *sh = prog->_LinkedShaders[i];
if (sh == NULL)
continue;
@@ -199,7 +199,7 @@ link_assign_atomic_counter_resources(struct gl_context *ctx,
}
/* Assign stage-specific fields. */
- for (unsigned j = 0; j < MESA_SHADER_TYPES; ++j)
+ for (unsigned j = 0; j < MESA_SHADER_STAGES; ++j)
mab.StageReferences[j] =
(ab.stage_references[j] ? GL_TRUE : GL_FALSE);
@@ -219,18 +219,18 @@ link_check_atomic_counter_resources(struct gl_context *ctx,
ctx->Const.GeometryProgram.MaxAtomicCounters,
ctx->Const.FragmentProgram.MaxAtomicCounters
};
- STATIC_ASSERT(Elements(max_atomic_counters) == MESA_SHADER_TYPES);
+ STATIC_ASSERT(Elements(max_atomic_counters) == MESA_SHADER_STAGES);
const unsigned max_atomic_buffers[] = {
ctx->Const.VertexProgram.MaxAtomicBuffers,
ctx->Const.GeometryProgram.MaxAtomicBuffers,
ctx->Const.FragmentProgram.MaxAtomicBuffers
};
- STATIC_ASSERT(Elements(max_atomic_buffers) == MESA_SHADER_TYPES);
+ STATIC_ASSERT(Elements(max_atomic_buffers) == MESA_SHADER_STAGES);
unsigned num_buffers;
active_atomic_buffer *const abs =
find_active_atomic_counters(ctx, prog, &num_buffers);
- unsigned atomic_counters[MESA_SHADER_TYPES] = {};
- unsigned atomic_buffers[MESA_SHADER_TYPES] = {};
+ unsigned atomic_counters[MESA_SHADER_STAGES] = {};
+ unsigned atomic_buffers[MESA_SHADER_STAGES] = {};
unsigned total_atomic_counters = 0;
unsigned total_atomic_buffers = 0;
@@ -243,7 +243,7 @@ link_check_atomic_counter_resources(struct gl_context *ctx,
if (abs[i].size == 0)
continue;
- for (unsigned j = 0; j < MESA_SHADER_TYPES; ++j) {
+ for (unsigned j = 0; j < MESA_SHADER_STAGES; ++j) {
const unsigned n = abs[i].stage_references[j];
if (n) {
@@ -256,14 +256,14 @@ link_check_atomic_counter_resources(struct gl_context *ctx,
}
/* Check that they are within the supported limits. */
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
if (atomic_counters[i] > max_atomic_counters[i])
linker_error(prog, "Too many %s shader atomic counters",
- _mesa_shader_type_to_string(i));
+ _mesa_shader_stage_to_string(i));
if (atomic_buffers[i] > max_atomic_buffers[i])
linker_error(prog, "Too many %s shader atomic counter buffers",
- _mesa_shader_type_to_string(i));
+ _mesa_shader_stage_to_string(i));
}
if (total_atomic_counters > ctx->Const.MaxCombinedAtomicCounters)