aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/context.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-13 10:09:30 +0200
committermarha <marha@users.sourceforge.net>2012-08-13 10:09:30 +0200
commit9ddf44af81782451cee798e06749ce3067a14a41 (patch)
treef84b06f6897929113f080d8e505621fa6bf73fb9 /mesalib/src/mesa/main/context.c
parentf8e35ebbe71eed74ccf68af8ccda4182f1edc7f0 (diff)
downloadvcxsrv-9ddf44af81782451cee798e06749ce3067a14a41.tar.gz
vcxsrv-9ddf44af81782451cee798e06749ce3067a14a41.tar.bz2
vcxsrv-9ddf44af81782451cee798e06749ce3067a14a41.zip
mesa pixman xkeyboard-config xserver git update 13 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/main/context.c')
-rw-r--r--mesalib/src/mesa/main/context.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index 7616eb78b..b78bceeb9 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -476,7 +476,8 @@ _mesa_init_current(struct gl_context *ctx)
* Important: drivers should override these with actual limits.
*/
static void
-init_program_limits(GLenum type, struct gl_program_constants *prog)
+init_program_limits(struct gl_context *ctx, GLenum type,
+ struct gl_program_constants *prog)
{
prog->MaxInstructions = MAX_PROGRAM_INSTRUCTIONS;
prog->MaxAluInstructions = MAX_PROGRAM_INSTRUCTIONS;
@@ -542,7 +543,9 @@ init_program_limits(GLenum type, struct gl_program_constants *prog)
prog->LowInt = prog->HighInt = prog->MediumInt;
prog->MaxUniformBlocks = 12;
- prog->MaxCombinedUniformComponents = prog->MaxUniformComponents;
+ prog->MaxCombinedUniformComponents = (prog->MaxUniformComponents +
+ ctx->Const.MaxUniformBlockSize / 4 *
+ prog->MaxUniformBlocks);
}
@@ -589,14 +592,21 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxSpotExponent = 128.0;
ctx->Const.MaxViewportWidth = MAX_VIEWPORT_WIDTH;
ctx->Const.MaxViewportHeight = MAX_VIEWPORT_HEIGHT;
+
+ /** GL_ARB_uniform_buffer_object */
+ ctx->Const.MaxCombinedUniformBlocks = 36;
+ ctx->Const.MaxUniformBufferBindings = 36;
+ ctx->Const.MaxUniformBlockSize = 16384;
+ ctx->Const.UniformBufferOffsetAlignment = 1;
+
#if FEATURE_ARB_vertex_program
- init_program_limits(GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
+ init_program_limits(ctx, GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
#endif
#if FEATURE_ARB_fragment_program
- init_program_limits(GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.FragmentProgram);
+ init_program_limits(ctx, GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.FragmentProgram);
#endif
#if FEATURE_ARB_geometry_shader4
- init_program_limits(MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram);
+ init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram);
#endif
ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
@@ -655,12 +665,6 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS;
ctx->Const.MaxVertexStreams = 1;
- /** GL_ARB_uniform_buffer_object */
- ctx->Const.MaxCombinedUniformBlocks = 36;
- ctx->Const.MaxUniformBufferBindings = 36;
- ctx->Const.MaxUniformBlockSize = 16384;
- ctx->Const.UniformBufferOffsetAlignment = 1;
-
/* GL 3.2: hard-coded for now: */
ctx->Const.ProfileMask = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;