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

Rob Clark robdclark at gmail.com
Wed Feb 17 21:32:11 UTC 2016


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



More information about the mesa-dev mailing list