[Mesa-dev] [PATCH] glsl: fix standalone compiler

Samuel Iglesias Gonsálvez siglesias at igalia.com
Fri Feb 19 11:33:45 UTC 2016


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On Wed, Feb 17, 2016 at 04:32:11PM -0500, Rob Clark wrote:
> From: Rob Clark <robclark at freedesktop.org>
> 
> Need to set some non-zero limits for MaxCombinedUniformComponents,
> otherwise we hit an "Too many <type> shader uniform components" error
> in the linker.
> 
> Signed-off-by: Rob Clark <robclark at freedesktop.org>
> ---
>  src/compiler/glsl/main.cpp | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/src/compiler/glsl/main.cpp b/src/compiler/glsl/main.cpp
> index bdf2f07..d253575 100644
> --- a/src/compiler/glsl/main.cpp
> +++ b/src/compiler/glsl/main.cpp
> @@ -61,6 +61,7 @@ initialize_context(struct gl_context *ctx, gl_api api)
>     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].MaxCombinedUniformComponents = 1024;
>     ctx->Const.Program[MESA_SHADER_COMPUTE].MaxInputComponents = 0; /* not used */
>     ctx->Const.Program[MESA_SHADER_COMPUTE].MaxOutputComponents = 0; /* not used */
>     ctx->Const.Program[MESA_SHADER_COMPUTE].MaxAtomicBuffers = 8;
> @@ -82,12 +83,14 @@ initialize_context(struct gl_context *ctx, gl_api api)
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 8;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 128 * 4;
> +      ctx->Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents = 128 * 4;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32;
>  
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits =
>           ctx->Const.MaxCombinedTextureImageUnits;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 16 * 4;
> +      ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents = 16 * 4;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
>           ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
> @@ -108,12 +111,14 @@ initialize_context(struct gl_context *ctx, gl_api api)
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512;
> +      ctx->Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents = 512;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32;
>  
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits =
>           ctx->Const.MaxCombinedTextureImageUnits;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64;
> +      ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents = 64;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
>           ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
> @@ -134,11 +139,13 @@ initialize_context(struct gl_context *ctx, gl_api api)
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
> +      ctx->Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents = 1024;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64;
>  
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024;
> +      ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents = 1024;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
>           ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
> @@ -158,17 +165,20 @@ initialize_context(struct gl_context *ctx, gl_api api)
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
> +      ctx->Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents = 1024;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64;
>  
>        ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16;
>        ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents = 1024;
> +      ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxCombinedUniformComponents = 1024;
>        ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents =
>           ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
>        ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = 128;
>  
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024;
> +      ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents = 1024;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
>           ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
> @@ -196,11 +206,13 @@ initialize_context(struct gl_context *ctx, gl_api api)
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
> +      ctx->Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents = 1024;
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
>        ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 16 * 4;
>  
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 224;
> +      ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents = 224;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 15 * 4;
>        ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
>  
> -- 
> 2.5.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160219/8087f86a/attachment.sig>


More information about the mesa-dev mailing list