diff options
author | Francisco Jerez <[email protected]> | 2013-10-07 18:53:40 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2013-10-29 12:40:55 -0700 |
commit | 1c7dcfed7ceb9e47943d6adaacc1ca483c97fcf6 (patch) | |
tree | 2452628247d8021725a47e408c1300d4f0d63363 /src/mesa/main/context.c | |
parent | e3fd31dc411c023495970ac51ce28b4d0deb80e6 (diff) |
mesa: Add support for ARB_shader_atomic_counters.
This patch implements the common support code required for the
ARB_shader_atomic_counters extension. It defines the necessary data
structures for tracking atomic counter buffer objects (from now on
"ABOs") associated with some specific context or shader program, it
implements support for binding buffers to an ABO binding point and
querying the existing atomic counters and buffers declared by GLSL
shaders.
v2: Fix extension checks. Drop unused MAX_ATOMIC_BUFFERS constant.
Acked-by: Paul Berry <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 0d1f71c7142..6cdeed19b0a 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -537,6 +537,9 @@ init_program_limits(struct gl_context *ctx, GLenum type, prog->MaxCombinedUniformComponents = (prog->MaxUniformComponents + ctx->Const.MaxUniformBlockSize / 4 * prog->MaxUniformBlocks); + + prog->MaxAtomicBuffers = 0; + prog->MaxAtomicCounters = 0; } @@ -669,6 +672,12 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxColorTextureSamples = 1; ctx->Const.MaxDepthTextureSamples = 1; ctx->Const.MaxIntegerSamples = 1; + + /* GL_ARB_shader_atomic_counters */ + ctx->Const.MaxAtomicBufferBindings = MAX_COMBINED_ATOMIC_BUFFERS; + ctx->Const.MaxAtomicBufferSize = MAX_ATOMIC_COUNTERS * ATOMIC_COUNTER_SIZE; + ctx->Const.MaxCombinedAtomicBuffers = MAX_COMBINED_ATOMIC_BUFFERS; + ctx->Const.MaxCombinedAtomicCounters = MAX_ATOMIC_COUNTERS; } |