-/* $Id: teximage.c,v 1.46 2000/09/05 15:40:34 brianp Exp $ */
+/* $Id: teximage.c,v 1.47 2000/09/05 22:04:30 brianp Exp $ */
/*
* Mesa 3-D graphics library
+/*
+ * This is called when a proxy texture test fails, we set all the
+ * image members (except DriverData) to zero.
+ */
+static void
+clear_proxy_teximage(struct gl_texture_image *img)
+{
+ ASSERT(img);
+ img->Format = 0;
+ img->IntFormat = 0;
+ img->RedBits = 0;
+ img->GreenBits = 0;
+ img->BlueBits = 0;
+ img->AlphaBits = 0;
+ img->IntensityBits = 0;
+ img->LuminanceBits = 0;
+ img->IndexBits = 0;
+ img->Border = 0;
+ img->Width = 0;
+ img->Height = 0;
+ img->Depth = 0;
+ img->Width2 = 0;
+ img->Height2 = 0;
+ img->Depth2 = 0;
+ img->WidthLog2 = 0;
+ img->HeightLog2 = 0;
+ img->DepthLog2 = 0;
+ img->Data = NULL;
+ img->IsCompressed = 0;
+ img->CompressedSize = 0;
+}
+
+
+
/*
* Test glTexImage[123]D() parameters for errors.
* Input:
format, type, 1, postConvWidth, 1, 1, border)) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
- MEMSET( ctx->Texture.Proxy1D->Image[level], 0,
- sizeof(struct gl_texture_image) );
+ clear_proxy_teximage(ctx->Texture.Proxy1D->Image[level]);
}
}
else {
format, type, 2, postConvWidth, height, 1, border)) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
- MEMSET( ctx->Texture.Proxy2D->Image[level], 0,
- sizeof(struct gl_texture_image) );
+ clear_proxy_teximage(ctx->Texture.Proxy2D->Image[level]);
}
}
else {
format, type, 3, width, height, depth, border)) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
- MEMSET( ctx->Texture.Proxy3D->Image[level], 0,
- sizeof(struct gl_texture_image) );
+ clear_proxy_teximage(ctx->Texture.Proxy3D->Image[level]);
}
}
else {
GL_NONE, GL_NONE, 1, width, 1, 1, border)) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
- MEMSET( ctx->Texture.Proxy1D->Image[level], 0,
- sizeof(struct gl_texture_image) );
+ clear_proxy_teximage(ctx->Texture.Proxy1D->Image[level]);
}
}
else {
GL_NONE, GL_NONE, 1, width, 1, 1, border)) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
- MEMSET( ctx->Texture.Proxy2D->Image[level], 0,
- sizeof(struct gl_texture_image) );
+ clear_proxy_teximage(ctx->Texture.Proxy2D->Image[level]);
}
}
else {
GL_NONE, GL_NONE, 1, width, height, depth, border)) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
- MEMSET( ctx->Texture.Proxy3D->Image[level], 0,
- sizeof(struct gl_texture_image) );
+ clear_proxy_teximage(ctx->Texture.Proxy3D->Image[level]);
}
}
else {