From 12c6d28cc7ef36a27389003e9898b512b6f722f9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Jan 2009 13:25:41 -0700 Subject: mesa: remove GL_DEPTH_TEST + no depth buffer test One could enable depth testing before binding an FBO that has a depth buffer so this test is no longer useful or correct. --- src/mesa/main/enable.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 160a6fc086..dae576ae5a 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -341,10 +341,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) ctx->Transform.CullVertexFlag = state; break; case GL_DEPTH_TEST: - if (state && ctx->DrawBuffer->Visual.depthBits == 0) { - _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer"); - return; - } if (ctx->Depth.Test == state) return; FLUSH_VERTICES(ctx, _NEW_DEPTH); -- cgit v1.2.3 From dbda49a9e65f684ca46c7af84cc52d63b0622978 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 20 Jan 2009 11:12:17 +0100 Subject: Add RGBA4444 and RGBA5551 texture formats. --- src/mesa/main/colormac.h | 4 ++ src/mesa/main/texformat.c | 48 +++++++++++++++++++ src/mesa/main/texformat.h | 4 ++ src/mesa/main/texformat_tmp.h | 47 +++++++++++++++++++ src/mesa/main/texstore.c | 107 ++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/texstore.h | 2 + 6 files changed, 212 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index a34bd2ed38..74692e9a98 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -195,6 +195,10 @@ do { \ #define PACK_COLOR_565_REV( X, Y, Z ) \ (((X) & 0xf8) | ((Y) & 0xe0) >> 5 | (((Y) & 0x1c) << 11) | (((Z) & 0xf8) << 5)) +#define PACK_COLOR_5551( R, G, B, A ) \ + ((((R) & 0xf8) << 8) | (((G) & 0xf8) << 3) | (((B) & 0xf8) >> 2) | \ + ((A) ? 1 : 0)) + #define PACK_COLOR_1555( A, B, G, R ) \ ((((B) & 0xf8) << 7) | (((G) & 0xf8) << 2) | (((R) & 0xf8) >> 3) | \ ((A) ? 0x8000 : 0)) diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 1dd7bdd9ce..08725846c6 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -871,6 +871,30 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { store_texel_rgb565_rev /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_rgba4444 = { + MESA_FORMAT_RGBA4444, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 4, /* RedBits */ + 4, /* GreenBits */ + 4, /* BlueBits */ + 4, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 2, /* TexelBytes */ + _mesa_texstore_rgba4444, /* StoreTexImageFunc */ + fetch_texel_1d_rgba4444, /* FetchTexel1D */ + fetch_texel_2d_rgba4444, /* FetchTexel2D */ + fetch_texel_3d_rgba4444, /* FetchTexel3D */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ + store_texel_rgba4444 /* StoreTexel */ +}; + const struct gl_texture_format _mesa_texformat_argb4444 = { MESA_FORMAT_ARGB4444, /* MesaFormat */ GL_RGBA, /* BaseFormat */ @@ -919,6 +943,30 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { store_texel_argb4444_rev /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_rgba5551 = { + MESA_FORMAT_RGBA5551, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 5, /* RedBits */ + 5, /* GreenBits */ + 5, /* BlueBits */ + 1, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 2, /* TexelBytes */ + _mesa_texstore_rgba5551, /* StoreTexImageFunc */ + fetch_texel_1d_rgba5551, /* FetchTexel1D */ + fetch_texel_2d_rgba5551, /* FetchTexel2D */ + fetch_texel_3d_rgba5551, /* FetchTexel3D */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ + store_texel_rgba5551 /* StoreTexel */ +}; + const struct gl_texture_format _mesa_texformat_argb1555 = { MESA_FORMAT_ARGB1555, /* MesaFormat */ GL_RGBA, /* BaseFormat */ diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 18900fe08b..b1604d4a49 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -70,8 +70,10 @@ enum _format { MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ + MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */ MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ + MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ @@ -200,10 +202,12 @@ extern const struct gl_texture_format _mesa_texformat_rgb888; extern const struct gl_texture_format _mesa_texformat_bgr888; extern const struct gl_texture_format _mesa_texformat_rgb565; extern const struct gl_texture_format _mesa_texformat_rgb565_rev; +extern const struct gl_texture_format _mesa_texformat_rgba4444; extern const struct gl_texture_format _mesa_texformat_argb4444; extern const struct gl_texture_format _mesa_texformat_argb4444_rev; extern const struct gl_texture_format _mesa_texformat_argb1555; extern const struct gl_texture_format _mesa_texformat_argb1555_rev; +extern const struct gl_texture_format _mesa_texformat_rgba5551; extern const struct gl_texture_format _mesa_texformat_al88; extern const struct gl_texture_format _mesa_texformat_al88_rev; extern const struct gl_texture_format _mesa_texformat_rgb332; diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 7499ba7b36..197593df74 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -803,6 +803,30 @@ static void store_texel_rgb565_rev(struct gl_texture_image *texImage, } #endif +/* MESA_FORMAT_RGBA4444 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ +static void FETCH(rgba4444)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); + texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); + texel[BCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); + texel[ACOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); +} + +#if DIM == 3 +static void store_texel_rgba4444(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + /* MESA_FORMAT_ARGB4444 ******************************************************/ @@ -852,6 +876,29 @@ static void store_texel_argb4444_rev(struct gl_texture_image *texImage, } #endif +/* MESA_FORMAT_RGBA5551 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ +static void FETCH(rgba5551)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); + texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xf8) | ((s >> 8) & 0x7) ); + texel[BCOMP] = UBYTE_TO_CHAN( ((s << 2) & 0xf8) | ((s >> 3) & 0x7) ); + texel[ACOMP] = UBYTE_TO_CHAN( ((s) & 0x01) ? 255 : 0); +} + +#if DIM == 3 +static void store_texel_rgba5551(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif /* MESA_FORMAT_ARGB1555 ******************************************************/ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 4b2b129468..67cfca2565 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1898,6 +1898,60 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) return GL_TRUE; } +GLboolean +_mesa_texstore_rgba4444(TEXSTORE_PARAMS) +{ + ASSERT(dstFormat == &_mesa_texformat_rgba4444); + ASSERT(dstFormat->TexelBytes == 2); + + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == &_mesa_texformat_rgba4444 && + baseInternalFormat == GL_RGBA && + srcFormat == GL_RGBA && + srcType == GL_UNSIGNED_SHORT_4_4_4_4){ + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else { + /* general path */ + const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, + baseInternalFormat, + dstFormat->BaseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLchan *src = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstYoffset * dstRowStride + + dstXoffset * dstFormat->TexelBytes; + for (row = 0; row < srcHeight; row++) { + GLushort *dstUS = (GLushort *) dstRow; + for (col = 0; col < srcWidth; col++) { + dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[RCOMP]), + CHAN_TO_UBYTE(src[GCOMP]), + CHAN_TO_UBYTE(src[BCOMP]), + CHAN_TO_UBYTE(src[ACOMP]) ); + src += 4; + } + dstRow += dstRowStride; + } + } + _mesa_free((void *) tempImage); + } + return GL_TRUE; +} GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) @@ -1966,7 +2020,60 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) return GL_TRUE; } +GLboolean +_mesa_texstore_rgba5551(TEXSTORE_PARAMS) +{ + ASSERT(dstFormat == &_mesa_texformat_rgba5551); + ASSERT(dstFormat->TexelBytes == 2); + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == &_mesa_texformat_rgba5551 && + baseInternalFormat == GL_RGBA && + srcFormat == GL_RGBA && + srcType == GL_UNSIGNED_SHORT_5_5_5_1) { + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else { + /* general path */ + const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, + baseInternalFormat, + dstFormat->BaseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLchan *src =tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstYoffset * dstRowStride + + dstXoffset * dstFormat->TexelBytes; + for (row = 0; row < srcHeight; row++) { + GLushort *dstUS = (GLushort *) dstRow; + for (col = 0; col < srcWidth; col++) { + dstUS[col] = PACK_COLOR_5551( CHAN_TO_UBYTE(src[RCOMP]), + CHAN_TO_UBYTE(src[GCOMP]), + CHAN_TO_UBYTE(src[BCOMP]), + CHAN_TO_UBYTE(src[ACOMP]) ); + src += 4; + } + dstRow += dstRowStride; + } + } + _mesa_free((void *) tempImage); + } + return GL_TRUE; +} GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS) diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index c9edf14dbc..951d0a112b 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -46,8 +46,10 @@ extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS); -- cgit v1.2.3 From 5c84a1032c13a75b95e40bd316495b3351b324e1 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 20 Jan 2009 11:13:05 +0100 Subject: Fix store texel for argb8888_rev. --- src/mesa/main/texformat_tmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 197593df74..673b715950 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -694,7 +694,7 @@ static void store_texel_argb8888_rev(struct gl_texture_image *texImage, { const GLubyte *rgba = (const GLubyte *) texel; GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); + *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]); } #endif -- cgit v1.2.3 From 7374285f07b673dcba1d1f47dd987c8ba7037bad Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 20 Jan 2009 11:13:38 +0100 Subject: Fix store texel for argb4444. --- src/mesa/main/texformat_tmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 673b715950..5f0c674d4f 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -848,7 +848,7 @@ static void store_texel_argb4444(struct gl_texture_image *texImage, { const GLubyte *rgba = (const GLubyte *) texel; GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); + *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); } #endif -- cgit v1.2.3 From bb63a663b1a3a3a3f27ebc8b1a678c3bc7cc4a69 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2009 09:13:41 -0700 Subject: mesa: bump version to 7.3-rc3 --- Makefile | 8 ++++---- src/mesa/main/version.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa/main') diff --git a/Makefile b/Makefile index 894e373709..ebc52546de 100644 --- a/Makefile +++ b/Makefile @@ -174,10 +174,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.3-rc2 -LIB_NAME = MesaLib-7.3-rc2 -DEMO_NAME = MesaDemos-7.3-rc2 -GLUT_NAME = MesaGLUT-7.3-rc2 +DIRECTORY = Mesa-7.3-rc3 +LIB_NAME = MesaLib-7.3-rc3 +DEMO_NAME = MesaDemos-7.3-rc3 +GLUT_NAME = MesaGLUT-7.3-rc3 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 24495d608a..3d874c8ba8 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -31,7 +31,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 3 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.3-rc2" +#define MESA_VERSION_STRING "7.3-rc3" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 4683cab29a74d6b3cefdd915aaf91e6b4f667d27 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Jan 2009 08:18:07 -0700 Subject: mesa: add some debug assertions to detect null current texture object pointers See bug #17895. These assertions could be removed when this is resolved. --- src/mesa/main/texobj.c | 14 ++++++++++++++ src/mesa/main/texstate.c | 8 ++++++++ 2 files changed, 22 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index d8e8b559f5..7848f0be35 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -762,24 +762,31 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj) struct gl_texture_unit *unit = &ctx->Texture.Unit[u]; if (texObj == unit->Current1D) { _mesa_reference_texobj(&unit->Current1D, ctx->Shared->Default1D); + ASSERT(unit->Current1D); } else if (texObj == unit->Current2D) { _mesa_reference_texobj(&unit->Current2D, ctx->Shared->Default2D); + ASSERT(unit->Current2D); } else if (texObj == unit->Current3D) { _mesa_reference_texobj(&unit->Current3D, ctx->Shared->Default3D); + ASSERT(unit->Current3D); } else if (texObj == unit->CurrentCubeMap) { _mesa_reference_texobj(&unit->CurrentCubeMap, ctx->Shared->DefaultCubeMap); + ASSERT(unit->CurrentCubeMap); } else if (texObj == unit->CurrentRect) { _mesa_reference_texobj(&unit->CurrentRect, ctx->Shared->DefaultRect); + ASSERT(unit->CurrentRect); } else if (texObj == unit->Current1DArray) { _mesa_reference_texobj(&unit->Current1DArray, ctx->Shared->Default1DArray); + ASSERT(unit->Current1DArray); } else if (texObj == unit->Current2DArray) { _mesa_reference_texobj(&unit->Current2DArray, ctx->Shared->Default2DArray); + ASSERT(unit->Current2DArray); } } } @@ -953,24 +960,31 @@ _mesa_BindTexture( GLenum target, GLuint texName ) switch (target) { case GL_TEXTURE_1D: _mesa_reference_texobj(&texUnit->Current1D, newTexObj); + ASSERT(texUnit->Current1D); break; case GL_TEXTURE_2D: _mesa_reference_texobj(&texUnit->Current2D, newTexObj); + ASSERT(texUnit->Current2D); break; case GL_TEXTURE_3D: _mesa_reference_texobj(&texUnit->Current3D, newTexObj); + ASSERT(texUnit->Current3D); break; case GL_TEXTURE_CUBE_MAP_ARB: _mesa_reference_texobj(&texUnit->CurrentCubeMap, newTexObj); + ASSERT(texUnit->CurrentCubeMap); break; case GL_TEXTURE_RECTANGLE_NV: _mesa_reference_texobj(&texUnit->CurrentRect, newTexObj); + ASSERT(texUnit->CurrentRect); break; case GL_TEXTURE_1D_ARRAY_EXT: texUnit->Current1DArray = newTexObj; + ASSERT(texUnit->Current1DArray); break; case GL_TEXTURE_2D_ARRAY_EXT: texUnit->Current2DArray = newTexObj; + ASSERT(texUnit->Current2DArray); break; default: /* Bad target should be caught above */ diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 29955d76cb..9bfb7e0ec2 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -517,6 +517,14 @@ update_texture_state( GLcontext *ctx ) enableBits = texUnit->Enabled; } + ASSERT(texUnit->Current1D); + ASSERT(texUnit->Current2D); + ASSERT(texUnit->Current3D); + ASSERT(texUnit->CurrentCubeMap); + ASSERT(texUnit->CurrentRect); + ASSERT(texUnit->Current1DArray); + ASSERT(texUnit->Current2DArray); + /* Look for the highest-priority texture target that's enabled and * complete. That's the one we'll use for texturing. If we're using * a fragment program we're guaranteed that bitcount(enabledBits) <= 1. -- cgit v1.2.3