aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/link_atomics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/link_atomics.cpp')
-rw-r--r--mesalib/src/glsl/link_atomics.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/mesalib/src/glsl/link_atomics.cpp b/mesalib/src/glsl/link_atomics.cpp
index 33903ad54..603329c50 100644
--- a/mesalib/src/glsl/link_atomics.cpp
+++ b/mesalib/src/glsl/link_atomics.cpp
@@ -21,6 +21,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include "glsl_parser_extras.h"
#include "ir.h"
#include "ir_uniform.h"
#include "linker.h"
@@ -213,20 +214,18 @@ void
link_check_atomic_counter_resources(struct gl_context *ctx,
struct gl_shader_program *prog)
{
- STATIC_ASSERT(MESA_SHADER_TYPES == 3);
- static const char *shader_names[MESA_SHADER_TYPES] = {
- "vertex", "geometry", "fragment"
- };
- 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);
@@ -260,11 +259,11 @@ link_check_atomic_counter_resources(struct gl_context *ctx,
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
if (atomic_counters[i] > max_atomic_counters[i])
linker_error(prog, "Too many %s shader atomic counters",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
if (atomic_buffers[i] > max_atomic_buffers[i])
linker_error(prog, "Too many %s shader atomic counter buffers",
- shader_names[i]);
+ _mesa_shader_type_to_string(i));
}
if (total_atomic_counters > ctx->Const.MaxCombinedAtomicCounters)