ir_variable *var = ((ir_instruction *)node)->as_variable();
if (var && var->type->contains_atomic()) {
- unsigned id;
+ unsigned id = 0;
bool found = prog->UniformHash->get(id, var->name);
assert(found);
+ (void) found;
active_atomic_buffer *buf = &buffers[var->data.binding];
/* If this is the first time the buffer is used, increment
link_check_atomic_counter_resources(struct gl_context *ctx,
struct gl_shader_program *prog)
{
- const unsigned max_atomic_counters[] = {
- ctx->Const.VertexProgram.MaxAtomicCounters,
- ctx->Const.GeometryProgram.MaxAtomicCounters,
- ctx->Const.FragmentProgram.MaxAtomicCounters
- };
- 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_STAGES);
unsigned num_buffers;
active_atomic_buffer *const abs =
find_active_atomic_counters(ctx, prog, &num_buffers);
/* 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));
}