From 47cf442c1164b6b406117fccfb8b564602741ee3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 May 2001 20:27:12 +0000 Subject: use DEFARRAY, etc macros to work around 32k data limit on Macs (Tom Goon) --- src/mesa/main/image.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 86883aa2cf..df7a89d005 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,4 +1,4 @@ -/* $Id: image.c,v 1.60 2001/05/15 21:21:08 brianp Exp $ */ +/* $Id: image.c,v 1.61 2001/05/16 20:27:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -805,7 +805,9 @@ _mesa_pack_float_rgba_span( GLcontext *ctx, if (transferOps) { /* make copy of incoming data */ - GLfloat rgbaCopy[MAX_WIDTH][4]; + DEFMARRAY(GLfloat, rgbaCopy, MAX_WIDTH, 4); /* mac 32k limitation */ + CHECKARRAY(rgbaCopy, return); /* mac 32k limitation */ + for (i = 0; i < n; i++) { rgbaCopy[i][0] = rgbaIn[i][0]; rgbaCopy[i][1] = rgbaIn[i][1]; @@ -866,9 +868,12 @@ _mesa_pack_float_rgba_span( GLcontext *ctx, /* min/max here */ if (transferOps & IMAGE_MIN_MAX_BIT) { _mesa_update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba); - if (ctx->MinMax.Sink) + if (ctx->MinMax.Sink) { + UNDEFARRAY(rgbaCopy); /* mac 32k limitation */ return; + } } + UNDEFARRAY(rgbaCopy); /* mac 32k limitation */ } else { /* use incoming data, not a copy */ @@ -1735,8 +1740,10 @@ _mesa_pack_rgba_span( GLcontext *ctx, } else { /* general solution */ - GLfloat rgba[MAX_WIDTH][4]; GLuint i; + DEFMARRAY(GLfloat, rgba, MAX_WIDTH, 4); /* mac 32k limitation */ + CHECKARRAY(rgba, return); /* mac 32k limitation */ + assert(n <= MAX_WIDTH); /* convert color components to floating point */ for (i=0;i