[Mesa-dev] [PATCH 03/11] glsl: add enable flags for ARB_compute_variable_group_size

Ian Romanick idr at freedesktop.org
Fri Sep 9 18:31:48 UTC 2016


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

I'm going to try to work through the rest of the glsl: patches today,
but I can't make any promises.

On 09/08/2016 01:31 PM, Samuel Pitoiset wrote:
> This also initializes the default values for the standalone compiler.
> 
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/compiler/glsl/glsl_parser_extras.cpp     | 1 +
>  src/compiler/glsl/glsl_parser_extras.h       | 2 ++
>  src/compiler/glsl/standalone.cpp             | 4 ++++
>  src/compiler/glsl/standalone_scaffolding.cpp | 5 +++++
>  4 files changed, 12 insertions(+)
> 
> diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
> index 436ddd0..bcbe623 100644
> --- a/src/compiler/glsl/glsl_parser_extras.cpp
> +++ b/src/compiler/glsl/glsl_parser_extras.cpp
> @@ -580,6 +580,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
>     EXT(ARB_ES3_2_compatibility),
>     EXT(ARB_arrays_of_arrays),
>     EXT(ARB_compute_shader),
> +   EXT(ARB_compute_variable_group_size),
>     EXT(ARB_conservative_depth),
>     EXT(ARB_cull_distance),
>     EXT(ARB_derivative_control),
> diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
> index e146fe1..8e0dafe 100644
> --- a/src/compiler/glsl/glsl_parser_extras.h
> +++ b/src/compiler/glsl/glsl_parser_extras.h
> @@ -576,6 +576,8 @@ struct _mesa_glsl_parse_state {
>     bool ARB_arrays_of_arrays_warn;
>     bool ARB_compute_shader_enable;
>     bool ARB_compute_shader_warn;
> +   bool ARB_compute_variable_group_size_enable;
> +   bool ARB_compute_variable_group_size_warn;
>     bool ARB_conservative_depth_enable;
>     bool ARB_conservative_depth_warn;
>     bool ARB_cull_distance_enable;
> diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
> index 88fe5fd..cb2da03 100644
> --- a/src/compiler/glsl/standalone.cpp
> +++ b/src/compiler/glsl/standalone.cpp
> @@ -58,6 +58,10 @@ initialize_context(struct gl_context *ctx, gl_api api)
>     ctx->Const.MaxComputeWorkGroupSize[2] = 64;
>     ctx->Const.MaxComputeWorkGroupInvocations = 1024;
>     ctx->Const.MaxComputeSharedMemorySize = 32768;
> +   ctx->Const.MaxComputeVariableGroupSize[0] = 512;
> +   ctx->Const.MaxComputeVariableGroupSize[1] = 512;
> +   ctx->Const.MaxComputeVariableGroupSize[2] = 64;
> +   ctx->Const.MaxComputeVariableGroupInvocations = 512;
>     ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits = 16;
>     ctx->Const.Program[MESA_SHADER_COMPUTE].MaxUniformComponents = 1024;
>     ctx->Const.Program[MESA_SHADER_COMPUTE].MaxCombinedUniformComponents = 1024;
> diff --git a/src/compiler/glsl/standalone_scaffolding.cpp b/src/compiler/glsl/standalone_scaffolding.cpp
> index b0fb4b7..decff5f 100644
> --- a/src/compiler/glsl/standalone_scaffolding.cpp
> +++ b/src/compiler/glsl/standalone_scaffolding.cpp
> @@ -144,6 +144,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
>     ctx->Extensions.dummy_false = false;
>     ctx->Extensions.dummy_true = true;
>     ctx->Extensions.ARB_compute_shader = true;
> +   ctx->Extensions.ARB_compute_variable_group_size = true;
>     ctx->Extensions.ARB_conservative_depth = true;
>     ctx->Extensions.ARB_draw_instanced = true;
>     ctx->Extensions.ARB_ES2_compatibility = true;
> @@ -207,6 +208,10 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
>     ctx->Const.MaxComputeWorkGroupSize[1] = 1024;
>     ctx->Const.MaxComputeWorkGroupSize[2] = 64;
>     ctx->Const.MaxComputeWorkGroupInvocations = 1024;
> +   ctx->Const.MaxComputeVariableGroupSize[0] = 512;
> +   ctx->Const.MaxComputeVariableGroupSize[1] = 512;
> +   ctx->Const.MaxComputeVariableGroupSize[2] = 64;
> +   ctx->Const.MaxComputeVariableGroupInvocations = 512;
>     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 */
> 



More information about the mesa-dev mailing list