[Mesa-dev] [PATCH 02/17] mesa: do not use a constant for MAX_COMPUTE_SHARED_SIZE
Marek Olšák
maraeo at gmail.com
Tue Jan 26 02:21:24 PST 2016
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Sun, Jan 24, 2016 at 10:09 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> This will allow to query the underlying drivers for the maximum
> total storage size of all variables declared as <shared> with
> PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/glsl/main.cpp | 1 +
> src/mesa/main/config.h | 5 -----
> src/mesa/main/get_hash_params.py | 2 +-
> src/mesa/main/mtypes.h | 1 +
> 4 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
> index ff705dc..bdf2f07 100644
> --- a/src/glsl/main.cpp
> +++ b/src/glsl/main.cpp
> @@ -58,6 +58,7 @@ initialize_context(struct gl_context *ctx, gl_api api)
> ctx->Const.MaxComputeWorkGroupSize[1] = 1024;
> ctx->Const.MaxComputeWorkGroupSize[2] = 64;
> ctx->Const.MaxComputeWorkGroupInvocations = 1024;
> + ctx->Const.MaxComputeSharedMemorySize = 32768;
> 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/config.h b/src/mesa/main/config.h
> index 1261b7b..820ae07 100644
> --- a/src/mesa/main/config.h
> +++ b/src/mesa/main/config.h
> @@ -288,11 +288,6 @@
> #define PERFQUERY_HAVE_GPA_EXTENDED_COUNTERS 0
> /*@}*/
>
> -/** For GL_ARB_compute_shader */
> -/*@{*/
> -#define MAX_COMPUTE_SHARED_MEMORY_SIZE 32768
> -/*@}*/
> -
> /** For GL_ARB_pipeline_statistics_query */
> #define MAX_PIPELINE_STATISTICS 11
>
> diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
> index 9bf0ac6..096db32 100644
> --- a/src/mesa/main/get_hash_params.py
> +++ b/src/mesa/main/get_hash_params.py
> @@ -459,7 +459,7 @@ descriptor=[
> [ "MAX_COMPUTE_TEXTURE_IMAGE_UNITS", "CONTEXT_INT(Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits), extra_ARB_compute_shader_es31" ],
> [ "MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_COMPUTE].MaxAtomicBuffers), extra_ARB_compute_shader_es31" ],
> [ "MAX_COMPUTE_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_COMPUTE].MaxAtomicCounters), extra_ARB_compute_shader_es31" ],
> - [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONST(MAX_COMPUTE_SHARED_MEMORY_SIZE), extra_ARB_compute_shader_es31" ],
> + [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONTEXT_INT(Const.MaxComputeSharedMemorySize), extra_ARB_compute_shader_es31" ],
> [ "MAX_COMPUTE_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_COMPUTE].MaxUniformComponents), extra_ARB_compute_shader_es31" ],
> [ "MAX_COMPUTE_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_COMPUTE].MaxImageUniforms), extra_ARB_compute_shader_es31" ],
> [ "DISPATCH_INDIRECT_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_compute_shader_es31" ],
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 15dd1ca..3376549 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -3707,6 +3707,7 @@ struct gl_constants
> GLuint MaxComputeWorkGroupCount[3]; /* Array of x, y, z dimensions */
> GLuint MaxComputeWorkGroupSize[3]; /* Array of x, y, z dimensions */
> GLuint MaxComputeWorkGroupInvocations;
> + GLuint MaxComputeSharedMemorySize;
>
> /** GL_ARB_gpu_shader5 */
> GLfloat MinFragmentInterpolationOffset;
> --
> 2.6.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list