[Mesa-dev] [PATCH] mesa: Initialize ctx->Const.MaxComputeSharedMemorySize to a default.

Kenneth Graunke kenneth at whitecape.org
Sat Feb 13 21:55:27 UTC 2016


Commit be27f772e8b97031bf5177 added ctx->Const.MaxComputeSharedMemorySize,
and added a line to initialize it to a default value of 32768 in the
standalone GLSL compiler, but didn't initialize a default value in real
GL contexts.

This regressed arb_compute_shader-minmax on i965, as the value of the
GL_MAX_COMPUTE_SHARED_MEMORY_SIZE query became 0.

Since 32768 is the minimum value required by GL_ARB_compute_shader,
let's set that by default; drivers can still override it if they need
to set a different value.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94139
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mesa/main/context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 9388a1c..d7677a3 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -709,6 +709,7 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api)
    consts->MaxComputeWorkGroupSize[1] = 1024;
    consts->MaxComputeWorkGroupSize[2] = 64;
    consts->MaxComputeWorkGroupInvocations = 1024;
+   consts->MaxComputeSharedMemorySize = 32768;
 
    /** GL_ARB_gpu_shader5 */
    consts->MinFragmentInterpolationOffset = MIN_FRAGMENT_INTERPOLATION_OFFSET;
-- 
2.7.1



More information about the mesa-dev mailing list