swrast: initialize program native limits
authorBrian Paul <brianp@vmware.com>
Tue, 30 Aug 2011 20:24:15 +0000 (14:24 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 31 Aug 2011 18:57:01 +0000 (12:57 -0600)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/swrast/s_context.c

index 792b528ee34ae470bb4d7c22b261710757c945a8..df213357fae833189391ed4f6da99d8367ff2849 100644 (file)
@@ -688,6 +688,24 @@ _swrast_allow_pixel_fog( struct gl_context *ctx, GLboolean value )
 }
 
 
+/**
+ * Initialize native program limits by copying the logical limits.
+ * See comments in init_program_limits() in context.c
+ */
+static void
+init_program_native_limits(struct gl_program_constants *prog)
+{
+   prog->MaxNativeInstructions = prog->MaxInstructions;
+   prog->MaxNativeAluInstructions = prog->MaxAluInstructions;
+   prog->MaxNativeTexInstructions = prog->MaxTexInstructions;
+   prog->MaxNativeTexIndirections = prog->MaxTexIndirections;
+   prog->MaxNativeAttribs = prog->MaxAttribs;
+   prog->MaxNativeTemps = prog->MaxTemps;
+   prog->MaxNativeAddressRegs = prog->MaxAddressRegs;
+   prog->MaxNativeParameters = prog->MaxParameters;
+}
+
+
 GLboolean
 _swrast_CreateContext( struct gl_context *ctx )
 {
@@ -769,6 +787,10 @@ _swrast_CreateContext( struct gl_context *ctx )
       return GL_FALSE;
    }
 
+   init_program_native_limits(&ctx->Const.VertexProgram);
+   init_program_native_limits(&ctx->Const.GeometryProgram);
+   init_program_native_limits(&ctx->Const.FragmentProgram);
+
    ctx->swrast_context = swrast;
 
    return GL_TRUE;