From: Paul Berry Date: Mon, 6 Jan 2014 23:11:40 +0000 (-0800) Subject: mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c85c50997f073993b86c694dda7c18bbaca30bbf;p=mesa.git mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant. Reviewed-by: Matt Turner v2: Use CONTEXT_INT rather than CONTEXT_ENUM. Reviewed-by: Jordan Justen --- diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index bb2054f9866..94bc1cc5e91 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -53,6 +53,7 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxComputeWorkGroupSize[0] = 1024; ctx->Const.MaxComputeWorkGroupSize[1] = 1024; ctx->Const.MaxComputeWorkGroupSize[2] = 64; + ctx->Const.MaxComputeWorkGroupInvocations = 1024; ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits = 16; ctx->Const.Program[MESA_SHADER_COMPUTE].MaxUniformComponents = 1024; ctx->Const.Program[MESA_SHADER_COMPUTE].MaxInputComponents = 0; /* not used */ diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp index 748d7e964d2..475fbd8edc8 100644 --- a/src/glsl/standalone_scaffolding.cpp +++ b/src/glsl/standalone_scaffolding.cpp @@ -144,6 +144,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Const.MaxComputeWorkGroupSize[0] = 1024; ctx->Const.MaxComputeWorkGroupSize[1] = 1024; ctx->Const.MaxComputeWorkGroupSize[2] = 64; + ctx->Const.MaxComputeWorkGroupInvocations = 1024; ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits = 16; ctx->Const.Program[MESA_SHADER_COMPUTE].MaxUniformComponents = 1024; ctx->Const.Program[MESA_SHADER_COMPUTE].MaxInputComponents = 0; /* not used */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index abebd82874a..4cf86bc5150 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -705,6 +705,7 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxComputeWorkGroupSize[0] = 1024; ctx->Const.MaxComputeWorkGroupSize[1] = 1024; ctx->Const.MaxComputeWorkGroupSize[2] = 64; + ctx->Const.MaxComputeWorkGroupInvocations = 1024; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index acd4d8c290b..2833a15a433 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -390,6 +390,7 @@ EXTRA_EXT(ARB_shader_atomic_counters); EXTRA_EXT(ARB_draw_indirect); EXTRA_EXT(ARB_shader_image_load_store); EXTRA_EXT(ARB_viewport_array); +EXTRA_EXT(ARB_compute_shader); static const int extra_ARB_color_buffer_float_or_glcore[] = { diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index 3a7f531b1e8..2e8a11682de 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -751,6 +751,9 @@ descriptor=[ [ "MAX_GEOMETRY_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxImageUniforms), extra_ARB_shader_image_load_store_and_geometry_shader"], [ "MAX_FRAGMENT_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), extra_ARB_shader_image_load_store"], [ "MAX_COMBINED_IMAGE_UNIFORMS", "CONTEXT_INT(Const.MaxCombinedImageUniforms), extra_ARB_shader_image_load_store"], + +# GL_ARB_compute_shader + [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", "CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), extra_ARB_compute_shader" ], ]}, # Enums restricted to OpenGL Core profile diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 08c5505f8c1..40e2e68f2d7 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3381,6 +3381,7 @@ struct gl_constants /** GL_ARB_compute_shader */ GLuint MaxComputeWorkGroupSize[3]; /* Array of x, y, z dimensions */ + GLuint MaxComputeWorkGroupInvocations; };