summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c32
-rw-r--r--src/mesa/main/attrib.c4
-rw-r--r--src/mesa/main/blend.c16
-rw-r--r--src/mesa/main/buffers.c4
-rw-r--r--src/mesa/main/context.c4
-rw-r--r--src/mesa/main/drawpix.c5
-rw-r--r--src/mesa/main/enable.c8
-rw-r--r--src/mesa/main/fog.h4
-rw-r--r--src/mesa/main/image.c4
-rw-r--r--src/mesa/main/pixel.c11
-rw-r--r--src/mesa/main/state.c5
-rw-r--r--src/mesa/main/teximage.c55
12 files changed, 73 insertions, 79 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 5d07bf3ae00..871143a1c5a 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.23 2000/10/29 18:23:28 brianp Exp $ */
+/* $Id: osmesa.c,v 1.24 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -621,7 +621,7 @@ static void clear_index( GLcontext *ctx, GLuint index )
static void clear_color( GLcontext *ctx,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+ GLchan r, GLchan g, GLchan b, GLchan a )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
osmesa->clearpixel = PACK_RGBA( r, g, b, a );
@@ -735,7 +735,7 @@ static void set_index( GLcontext *ctx, GLuint index )
static void set_color( GLcontext *ctx,
- GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+ GLchan r, GLchan g, GLchan b, GLchan a )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
osmesa->pixel = PACK_RGBA( r, g, b, a );
@@ -758,7 +758,7 @@ static void buffer_size( GLcontext *ctx, GLuint *width, GLuint *height )
/* Write RGBA pixels to an RGBA (or permuted) buffer. */
static void write_rgba_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
- CONST GLubyte rgba[][4], const GLubyte mask[] )
+ CONST GLchan rgba[][4], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint *ptr4 = PIXELADDR4( x, y );
@@ -785,7 +785,7 @@ static void write_rgba_span( const GLcontext *ctx,
/* Write RGBA pixels to an RGBA buffer. This is the fastest span-writer. */
static void write_rgba_span_rgba( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
- CONST GLubyte rgba[][4],
+ CONST GLchan rgba[][4],
const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
@@ -808,7 +808,7 @@ static void write_rgba_span_rgba( const GLcontext *ctx,
/* Write RGB pixels to an RGBA (or permuted) buffer. */
static void write_rgb_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
- CONST GLubyte rgb[][3], const GLubyte mask[] )
+ CONST GLchan rgb[][3], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint *ptr4 = PIXELADDR4( x, y );
@@ -851,7 +851,7 @@ static void write_monocolor_span( const GLcontext *ctx,
static void write_rgba_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
- CONST GLubyte rgba[][4], const GLubyte mask[] )
+ CONST GLchan rgba[][4], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint i;
@@ -885,7 +885,7 @@ static void write_monocolor_pixels( const GLcontext *ctx,
static void read_rgba_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
- GLubyte rgba[][4] )
+ GLchan rgba[][4] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint i;
@@ -903,17 +903,17 @@ static void read_rgba_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
/* Read RGBA pixels from an RGBA buffer */
static void read_rgba_span_rgba( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
- GLubyte rgba[][4] )
+ GLchan rgba[][4] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint *ptr4 = PIXELADDR4(x,y);
- MEMCPY( rgba, ptr4, n * 4 * sizeof(GLubyte) );
+ MEMCPY( rgba, ptr4, n * 4 * sizeof(GLchan) );
}
static void read_rgba_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
- GLubyte rgba[][4], const GLubyte mask[] )
+ GLchan rgba[][4], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint i;
@@ -936,7 +936,7 @@ static void read_rgba_pixels( const GLcontext *ctx,
/* Write RGBA pixels to an RGB or BGR buffer. */
static void write_rgba_span3( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
- CONST GLubyte rgba[][4], const GLubyte mask[] )
+ CONST GLchan rgba[][4], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLubyte *ptr3 = PIXELADDR3( x, y);
@@ -965,7 +965,7 @@ static void write_rgba_span3( const GLcontext *ctx,
/* Write RGB pixels to an RGB or BGR buffer. */
static void write_rgb_span3( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
- CONST GLubyte rgb[][3], const GLubyte mask[] )
+ CONST GLchan rgb[][3], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLubyte *ptr3 = PIXELADDR3( x, y);
@@ -1017,7 +1017,7 @@ static void write_monocolor_span3( const GLcontext *ctx,
static void write_rgba_pixels3( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
- CONST GLubyte rgba[][4], const GLubyte mask[] )
+ CONST GLchan rgba[][4], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint i;
@@ -1058,7 +1058,7 @@ static void write_monocolor_pixels3( const GLcontext *ctx,
static void read_rgba_span3( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
- GLubyte rgba[][4] )
+ GLchan rgba[][4] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint i;
@@ -1076,7 +1076,7 @@ static void read_rgba_span3( const GLcontext *ctx,
static void read_rgba_pixels3( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
- GLubyte rgba[][4], const GLubyte mask[] )
+ GLchan rgba[][4], const GLubyte mask[] )
{
OSMesaContext osmesa = (OSMesaContext) ctx;
GLuint i;
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index bacd2e1ca4d..cb894a86a9a 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,4 +1,4 @@
-/* $Id: attrib.c,v 1.31 2000/10/30 13:31:59 keithw Exp $ */
+/* $Id: attrib.c,v 1.32 2000/10/30 16:32:42 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -855,8 +855,6 @@ _mesa_PopAttrib(void)
FREE( attr );
attr = next;
}
-
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
}
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 65f890d10fa..4f20d269ac2 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -1,4 +1,4 @@
-/* $Id: blend.c,v 1.22 2000/10/30 13:31:59 keithw Exp $ */
+/* $Id: blend.c,v 1.23 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -370,19 +370,23 @@ blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[],
const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s) / 255;
const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s) / 255;
#else
+#if CHAN_BITS == 8
/* This satisfies Glean and should be reasonably fast */
/* Contributed by Nathan Hand */
-#if CHAN_BITS == 8
#define DIV255(X) (((X) << 8) + (X) + 256) >> 16
-#else
-XXX todo
-#endif
const GLint s = CHAN_MAX - t;
const GLint r = DIV255(rgba[i][RCOMP] * t + dest[i][RCOMP] * s);
const GLint g = DIV255(rgba[i][GCOMP] * t + dest[i][GCOMP] * s);
const GLint b = DIV255(rgba[i][BCOMP] * t + dest[i][BCOMP] * s);
const GLint a = DIV255(rgba[i][ACOMP] * t + dest[i][ACOMP] * s);
#undef DIV255
+#else
+ const GLint s = CHAN_MAX - t;
+ const GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s) / CHAN_MAX;
+ const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s) / CHAN_MAX;
+ const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s) / CHAN_MAX;
+ const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s) / CHAN_MAX;
+#endif
#endif
ASSERT(r <= CHAN_MAX);
ASSERT(g <= CHAN_MAX);
@@ -926,7 +930,7 @@ _mesa_blend_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
void
_mesa_blend_pixels( GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
- GLchan rgba[][4], const GLchan mask[] )
+ GLchan rgba[][4], const GLubyte mask[] )
{
GLchan dest[PB_SIZE][4];
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 33e7bc00161..c50590f6123 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,4 +1,4 @@
-/* $Id: buffers.c,v 1.16 2000/10/30 13:31:59 keithw Exp $ */
+/* $Id: buffers.c,v 1.17 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -175,7 +175,7 @@ clear_color_buffer(GLcontext *ctx)
ASSERT(ctx->Color.IndexMask == ~0);
if (ctx->Visual.IndexBits == 8) {
/* 8-bit clear */
- GLchan span[MAX_WIDTH];
+ GLubyte span[MAX_WIDTH];
GLint i;
MEMSET(span, ctx->Color.ClearIndex, width);
for (i = 0; i < height; i++) {
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 3268f55070c..26ef3c43dde 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.99 2000/10/30 13:32:00 keithw Exp $ */
+/* $Id: context.c,v 1.100 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1341,7 +1341,7 @@ init_attrib_groups( GLcontext *ctx )
ctx->StippleCounter = 0;
ctx->NeedNormals = GL_FALSE;
ctx->DoViewportMapping = GL_TRUE;
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->ImageTransferState = 0;
ctx->NeedEyeCoords = GL_FALSE;
ctx->NeedEyeNormals = GL_FALSE;
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 4b2fbacd6ad..3e030ede61a 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: drawpix.c,v 1.42 2000/10/29 19:02:23 brianp Exp $ */
+/* $Id: drawpix.c,v 1.43 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -866,9 +866,6 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
gl_update_state(ctx);
}
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
-
x = (GLint) (ctx->Current.RasterPos[0] + 0.5F);
y = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 6c5514fc98a..20e507a61d9 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.29 2000/10/30 13:32:00 keithw Exp $ */
+/* $Id: enable.c,v 1.30 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -516,17 +516,14 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
case GL_COLOR_TABLE_SGI:
/* XXX check for extension */
ctx->Pixel.ColorTableEnabled = state;
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
ctx->NewState |= _NEW_PIXEL;
break;
case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
ctx->Pixel.PostConvolutionColorTableEnabled = state;
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
ctx->NewState |= _NEW_PIXEL;
break;
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
ctx->Pixel.PostColorMatrixColorTableEnabled = state;
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
ctx->NewState |= _NEW_PIXEL;
break;
@@ -534,17 +531,14 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
case GL_CONVOLUTION_1D:
/* XXX check for extension */
ctx->Pixel.Convolution1DEnabled = state;
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
ctx->NewState |= _NEW_PIXEL;
break;
case GL_CONVOLUTION_2D:
ctx->Pixel.Convolution2DEnabled = state;
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
ctx->NewState |= _NEW_PIXEL;
break;
case GL_SEPARABLE_2D:
ctx->Pixel.Separable2DEnabled = state;
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
ctx->NewState |= _NEW_PIXEL;
break;
diff --git a/src/mesa/main/fog.h b/src/mesa/main/fog.h
index d5747426dd2..5841d750bee 100644
--- a/src/mesa/main/fog.h
+++ b/src/mesa/main/fog.h
@@ -1,4 +1,4 @@
-/* $Id: fog.h,v 1.7 2000/10/28 18:34:48 brianp Exp $ */
+/* $Id: fog.h,v 1.8 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -72,7 +72,7 @@ _mesa_win_fog_coords_from_z( const GLcontext *ctx,
extern void
_mesa_depth_fog_rgba_pixels( const GLcontext *ctx,
- GLuint n, const GLdepth z[], GLubyte rgba[][4] );
+ GLuint n, const GLdepth z[], GLchan rgba[][4] );
extern void
_mesa_depth_fog_ci_pixels( const GLcontext *ctx,
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 4cbf677072d..1711a75eab3 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.45 2000/10/29 18:12:15 brianp Exp $ */
+/* $Id: image.c,v 1.46 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1700,7 +1700,7 @@ _mesa_pack_rgba_span( GLcontext *ctx,
const struct gl_pixelstore_attrib *dstPacking,
GLuint transferOps)
{
- ASSERT(ctx->ImageTransferState != UPDATE_IMAGE_TRANSFER_STATE);
+ ASSERT((ctx->NewState & _NEW_PIXEL) == 0);
/* Test for optimized case first */
if (transferOps == 0 && dstFormat == GL_RGBA && dstType == CHAN_TYPE) {
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 4cd73efbf9d..a7787b667ae 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -1,4 +1,4 @@
-/* $Id: pixel.c,v 1.17 2000/10/30 13:32:01 keithw Exp $ */
+/* $Id: pixel.c,v 1.18 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -632,7 +632,6 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param )
}
/* signal to recompute the bitmask */
- ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
ctx->NewState |= _NEW_PIXEL;
}
@@ -1063,10 +1062,10 @@ _mesa_map_ci8_to_rgba( const GLcontext *ctx, GLuint n, const GLubyte index[],
GLuint gmask = ctx->Pixel.MapItoGsize - 1;
GLuint bmask = ctx->Pixel.MapItoBsize - 1;
GLuint amask = ctx->Pixel.MapItoAsize - 1;
- const GLfloat *rMap = ctx->Pixel.MapItoR8;
- const GLfloat *gMap = ctx->Pixel.MapItoG8;
- const GLfloat *bMap = ctx->Pixel.MapItoB8;
- const GLfloat *aMap = ctx->Pixel.MapItoA8;
+ const GLfloat *rMap = ctx->Pixel.MapItoR;
+ const GLfloat *gMap = ctx->Pixel.MapItoG;
+ const GLfloat *bMap = ctx->Pixel.MapItoB;
+ const GLfloat *aMap = ctx->Pixel.MapItoA;
GLuint i;
for (i=0;i<n;i++) {
rgba[i][RCOMP] = FLOAT_TO_CHAN(rMap[index[i] & rmask]);
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 13ed623dcc6..32727d09864 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.37 2000/10/30 13:32:01 keithw Exp $ */
+/* $Id: state.c,v 1.38 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -827,6 +827,9 @@ void gl_update_state( GLcontext *ctx )
if (MESA_VERBOSE & VERBOSE_STATE)
gl_print_state("", ctx->NewState);
+ if (ctx->NewState & _NEW_PIXEL)
+ _mesa_update_image_transfer_state(ctx);
+
if (ctx->NewState & _NEW_ARRAY)
gl_update_client_state( ctx );
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 4a6258e89b2..e47387fcb5b 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.56 2000/10/30 13:32:01 keithw Exp $ */
+/* $Id: teximage.c,v 1.57 2000/10/30 16:32:43 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -924,9 +924,8 @@ make_texture_image( GLcontext *ctx, GLuint dimensions,
const GLint components = components_in_intformat(internalFormat);
GLint convWidth = width, convHeight = height;
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE) {
- _mesa_update_image_transfer_state(ctx);
- }
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (ctx->ImageTransferState & IMAGE_CONVOLUTION_BIT) {
adjust_texture_size_for_convolution(ctx, dimensions,
@@ -1659,8 +1658,8 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
/* setup the teximage struct's fields */
init_texture_image(ctx, texImage, postConvWidth, 1, 1, border, internalFormat);
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
/* process the texture image */
if (pixels) {
@@ -1798,8 +1797,8 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
init_texture_image(ctx, texImage, postConvWidth, postConvHeight,
1, border, internalFormat);
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
/* process the texture image */
if (pixels) {
@@ -1941,8 +1940,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
init_texture_image(ctx, texImage, width, height, depth,
border, internalFormat);
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
/* process the texture image */
if (pixels) {
@@ -2228,8 +2227,8 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
GLint depth = texImage->Depth;
GLint img, row;
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (ctx->ImageTransferState & IMAGE_CONVOLUTION_BIT) {
/* convert texture image to GL_RGBA, GL_FLOAT */
@@ -2420,8 +2419,8 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
if (width == 0 || !pixels)
return; /* no-op, not an error */
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (!ctx->ImageTransferState && ctx->Driver.TexSubImage1D) {
success = (*ctx->Driver.TexSubImage1D)( ctx, target, level, xoffset,
@@ -2491,8 +2490,8 @@ _mesa_TexSubImage2D( GLenum target, GLint level,
if (width == 0 || height == 0 || !pixels)
return; /* no-op, not an error */
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (!ctx->ImageTransferState && ctx->Driver.TexSubImage2D) {
success = (*ctx->Driver.TexSubImage2D)( ctx, target, level, xoffset,
@@ -2574,8 +2573,8 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
if (width == 0 || height == 0 || height == 0 || !pixels)
return; /* no-op, not an error */
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (!ctx->ImageTransferState && ctx->Driver.TexSubImage3D) {
success = (*ctx->Driver.TexSubImage3D)( ctx, target, level, xoffset,
@@ -2672,8 +2671,8 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
width, 1, border))
return;
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (ctx->ImageTransferState || !ctx->Driver.CopyTexImage1D
|| !(*ctx->Driver.CopyTexImage1D)(ctx, target, level,
@@ -2712,8 +2711,8 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
width, height, border))
return;
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (ctx->ImageTransferState || !ctx->Driver.CopyTexImage2D
|| !(*ctx->Driver.CopyTexImage2D)(ctx, target, level,
@@ -2751,8 +2750,8 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
xoffset, 0, 0, width, 1))
return;
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (ctx->ImageTransferState || !ctx->Driver.CopyTexSubImage1D
|| !(*ctx->Driver.CopyTexSubImage1D)(ctx, target, level,
@@ -2798,8 +2797,8 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
xoffset, yoffset, 0, width, height))
return;
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (ctx->ImageTransferState || !ctx->Driver.CopyTexSubImage2D
|| !(*ctx->Driver.CopyTexSubImage2D)(ctx, target, level,
@@ -2845,8 +2844,8 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
xoffset, yoffset, zoffset, width, height))
return;
- if (ctx->ImageTransferState == UPDATE_IMAGE_TRANSFER_STATE)
- _mesa_update_image_transfer_state(ctx);
+ if (ctx->NewState & _NEW_PIXEL)
+ gl_update_state(ctx);
if (ctx->ImageTransferState || !ctx->Driver.CopyTexSubImage3D
|| !(*ctx->Driver.CopyTexSubImage3D)(ctx, target, level,