summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_atomics.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-08 10:17:01 -0800
committerPaul Berry <[email protected]>2014-01-09 09:31:19 -0800
commitbce8bc0b250c7d64ac7898ba032858963dee6a37 (patch)
tree7f0bc1b886f62d2061b34237e0f184913dbb309e /src/glsl/link_atomics.cpp
parentb539385789a95074cc53c9e16988d2384ec5c7de (diff)
glsl: Index into ctx->Const.Program[] rather than using ad-hoc code.
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/link_atomics.cpp')
-rw-r--r--src/glsl/link_atomics.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp
index 7f4ddafdbda..db9c5396562 100644
--- a/src/glsl/link_atomics.cpp
+++ b/src/glsl/link_atomics.cpp
@@ -214,18 +214,6 @@ void
link_check_atomic_counter_resources(struct gl_context *ctx,
struct gl_shader_program *prog)
{
- const unsigned max_atomic_counters[] = {
- ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters,
- ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters,
- ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters
- };
- STATIC_ASSERT(Elements(max_atomic_counters) == MESA_SHADER_STAGES);
- const unsigned max_atomic_buffers[] = {
- ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers,
- ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuffers,
- ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers
- };
- 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);
@@ -257,11 +245,11 @@ link_check_atomic_counter_resources(struct gl_context *ctx,
/* Check that they are within the supported limits. */
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
- if (atomic_counters[i] > max_atomic_counters[i])
+ if (atomic_counters[i] > ctx->Const.Program[i].MaxAtomicCounters)
linker_error(prog, "Too many %s shader atomic counters",
_mesa_shader_stage_to_string(i));
- if (atomic_buffers[i] > max_atomic_buffers[i])
+ if (atomic_buffers[i] > ctx->Const.Program[i].MaxAtomicBuffers)
linker_error(prog, "Too many %s shader atomic counter buffers",
_mesa_shader_stage_to_string(i));
}