+ switch (ctx->Const.GLSLVersion) {
+ case 100:
+ ctx->Const.MaxClipPlanes = 0;
+ ctx->Const.MaxCombinedTextureImageUnits = 8;
+ ctx->Const.MaxDrawBuffers = 2;
+ ctx->Const.MinProgramTexelOffset = 0;
+ ctx->Const.MaxProgramTexelOffset = 0;
+ ctx->Const.MaxLights = 0;
+ ctx->Const.MaxTextureCoordUnits = 0;
+ ctx->Const.MaxTextureUnits = 8;
+
+ ctx->Const.VertexProgram.MaxAttribs = 8;
+ ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
+ ctx->Const.VertexProgram.MaxUniformComponents = 128 * 4;
+ ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
+ ctx->Const.VertexProgram.MaxOutputComponents = 32;
+
+ ctx->Const.FragmentProgram.MaxTextureImageUnits =
+ ctx->Const.MaxCombinedTextureImageUnits;
+ ctx->Const.FragmentProgram.MaxUniformComponents = 16 * 4;
+ ctx->Const.FragmentProgram.MaxInputComponents =
+ ctx->Const.VertexProgram.MaxOutputComponents;
+ ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+
+ ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ break;
+ case 110:
+ case 120:
+ ctx->Const.MaxClipPlanes = 6;
+ ctx->Const.MaxCombinedTextureImageUnits = 2;
+ ctx->Const.MaxDrawBuffers = 1;
+ ctx->Const.MinProgramTexelOffset = 0;
+ ctx->Const.MaxProgramTexelOffset = 0;
+ ctx->Const.MaxLights = 8;
+ ctx->Const.MaxTextureCoordUnits = 2;
+ ctx->Const.MaxTextureUnits = 2;
+
+ ctx->Const.VertexProgram.MaxAttribs = 16;
+ ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
+ ctx->Const.VertexProgram.MaxUniformComponents = 512;
+ ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
+ ctx->Const.VertexProgram.MaxOutputComponents = 32;
+
+ ctx->Const.FragmentProgram.MaxTextureImageUnits =
+ ctx->Const.MaxCombinedTextureImageUnits;
+ ctx->Const.FragmentProgram.MaxUniformComponents = 64;
+ ctx->Const.FragmentProgram.MaxInputComponents =
+ ctx->Const.VertexProgram.MaxOutputComponents;
+ ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+
+ ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ break;
+ case 130:
+ case 140:
+ ctx->Const.MaxClipPlanes = 8;
+ ctx->Const.MaxCombinedTextureImageUnits = 16;
+ ctx->Const.MaxDrawBuffers = 8;
+ ctx->Const.MinProgramTexelOffset = -8;
+ ctx->Const.MaxProgramTexelOffset = 7;
+ ctx->Const.MaxLights = 8;
+ ctx->Const.MaxTextureCoordUnits = 8;
+ ctx->Const.MaxTextureUnits = 2;
+
+ ctx->Const.VertexProgram.MaxAttribs = 16;
+ ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
+ ctx->Const.VertexProgram.MaxUniformComponents = 1024;
+ ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
+ ctx->Const.VertexProgram.MaxOutputComponents = 64;
+
+ ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
+ ctx->Const.FragmentProgram.MaxUniformComponents = 1024;
+ ctx->Const.FragmentProgram.MaxInputComponents =
+ ctx->Const.VertexProgram.MaxOutputComponents;
+ ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+
+ ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ break;
+ case 150:
+ case 330:
+ ctx->Const.MaxClipPlanes = 8;
+ ctx->Const.MaxDrawBuffers = 8;
+ ctx->Const.MinProgramTexelOffset = -8;
+ ctx->Const.MaxProgramTexelOffset = 7;
+ ctx->Const.MaxLights = 8;
+ ctx->Const.MaxTextureCoordUnits = 8;
+ ctx->Const.MaxTextureUnits = 2;
+
+ ctx->Const.VertexProgram.MaxAttribs = 16;
+ ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
+ ctx->Const.VertexProgram.MaxUniformComponents = 1024;
+ ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
+ ctx->Const.VertexProgram.MaxOutputComponents = 64;
+
+ ctx->Const.GeometryProgram.MaxTextureImageUnits = 16;
+ ctx->Const.GeometryProgram.MaxUniformComponents = 1024;
+ ctx->Const.GeometryProgram.MaxInputComponents =
+ ctx->Const.VertexProgram.MaxOutputComponents;
+ ctx->Const.GeometryProgram.MaxOutputComponents = 128;
+
+ ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
+ ctx->Const.FragmentProgram.MaxUniformComponents = 1024;
+ ctx->Const.FragmentProgram.MaxInputComponents =
+ ctx->Const.GeometryProgram.MaxOutputComponents;
+ ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+
+ ctx->Const.MaxCombinedTextureImageUnits =
+ ctx->Const.VertexProgram.MaxTextureImageUnits
+ + ctx->Const.GeometryProgram.MaxTextureImageUnits
+ + ctx->Const.FragmentProgram.MaxTextureImageUnits;
+
+ ctx->Const.MaxGeometryOutputVertices = 256;
+ ctx->Const.MaxGeometryTotalOutputComponents = 1024;
+
+// ctx->Const.MaxGeometryVaryingComponents = 64;
+
+ ctx->Const.MaxVarying = 60 / 4;
+ break;
+ case 300:
+ ctx->Const.MaxClipPlanes = 8;
+ ctx->Const.MaxCombinedTextureImageUnits = 32;
+ ctx->Const.MaxDrawBuffers = 4;
+ ctx->Const.MinProgramTexelOffset = -8;
+ ctx->Const.MaxProgramTexelOffset = 7;
+ ctx->Const.MaxLights = 0;
+ ctx->Const.MaxTextureCoordUnits = 0;
+ ctx->Const.MaxTextureUnits = 0;
+
+ ctx->Const.VertexProgram.MaxAttribs = 16;
+ ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
+ ctx->Const.VertexProgram.MaxUniformComponents = 1024;
+ ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
+ ctx->Const.VertexProgram.MaxOutputComponents = 16 * 4;
+
+ ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
+ ctx->Const.FragmentProgram.MaxUniformComponents = 224;
+ ctx->Const.FragmentProgram.MaxInputComponents = 15 * 4;
+ ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+
+ ctx->Const.MaxVarying = ctx->Const.FragmentProgram.MaxInputComponents / 4;
+ break;
+ }