link_check_atomic_counter_resources(struct gl_context *ctx,
struct gl_shader_program *prog)
{
- STATIC_ASSERT(MESA_SHADER_TYPES == 3);
- const unsigned max_atomic_counters[MESA_SHADER_TYPES] = {
+ const unsigned max_atomic_counters[] = {
ctx->Const.VertexProgram.MaxAtomicCounters,
ctx->Const.GeometryProgram.MaxAtomicCounters,
ctx->Const.FragmentProgram.MaxAtomicCounters
};
- const unsigned max_atomic_buffers[MESA_SHADER_TYPES] = {
+ STATIC_ASSERT(Elements(max_atomic_counters) == MESA_SHADER_TYPES);
+ 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);
unsigned num_buffers;
active_atomic_buffer *const abs =
find_active_atomic_counters(ctx, prog, &num_buffers);
static void
check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
{
- const unsigned max_samplers[MESA_SHADER_TYPES] = {
+ const unsigned max_samplers[] = {
ctx->Const.VertexProgram.MaxTextureImageUnits,
ctx->Const.GeometryProgram.MaxTextureImageUnits,
ctx->Const.FragmentProgram.MaxTextureImageUnits
};
+ STATIC_ASSERT(Elements(max_samplers) == MESA_SHADER_TYPES);
- const unsigned max_default_uniform_components[MESA_SHADER_TYPES] = {
+ const unsigned max_default_uniform_components[] = {
ctx->Const.VertexProgram.MaxUniformComponents,
ctx->Const.GeometryProgram.MaxUniformComponents,
ctx->Const.FragmentProgram.MaxUniformComponents
};
+ STATIC_ASSERT(Elements(max_default_uniform_components) ==
+ MESA_SHADER_TYPES);
- const unsigned max_combined_uniform_components[MESA_SHADER_TYPES] = {
+ const unsigned max_combined_uniform_components[] = {
ctx->Const.VertexProgram.MaxCombinedUniformComponents,
ctx->Const.GeometryProgram.MaxCombinedUniformComponents,
ctx->Const.FragmentProgram.MaxCombinedUniformComponents
};
+ STATIC_ASSERT(Elements(max_combined_uniform_components) ==
+ MESA_SHADER_TYPES);
- const unsigned max_uniform_blocks[MESA_SHADER_TYPES] = {
+ const unsigned max_uniform_blocks[] = {
ctx->Const.VertexProgram.MaxUniformBlocks,
ctx->Const.GeometryProgram.MaxUniformBlocks,
ctx->Const.FragmentProgram.MaxUniformBlocks
};
+ STATIC_ASSERT(Elements(max_uniform_blocks) == MESA_SHADER_TYPES);
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
struct gl_shader *sh = prog->_LinkedShaders[i];