diff options
Diffstat (limited to 'mesalib/src/mesa/swrast')
-rw-r--r-- | mesalib/src/mesa/swrast/s_context.c | 22 | ||||
-rw-r--r-- | mesalib/src/mesa/swrast/s_readpix.c | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c index fbecbc55e..e65f6aa9d 100644 --- a/mesalib/src/mesa/swrast/s_context.c +++ b/mesalib/src/mesa/swrast/s_context.c @@ -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;
diff --git a/mesalib/src/mesa/swrast/s_readpix.c b/mesalib/src/mesa/swrast/s_readpix.c index e183f9bff..49da247e9 100644 --- a/mesalib/src/mesa/swrast/s_readpix.c +++ b/mesalib/src/mesa/swrast/s_readpix.c @@ -332,7 +332,7 @@ read_rgba_pixels( struct gl_context *ctx, /* width should never be > MAX_WIDTH since we did clipping earlier */
ASSERT(width <= MAX_WIDTH);
- do {
+ {
const GLint dstStride
= _mesa_image_row_stride(packing, width, format, type);
GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
@@ -359,7 +359,7 @@ read_rgba_pixels( struct gl_context *ctx, dst += dstStride;
}
- } while (0);
+ }
}
|