This patch also silences these GCC warnings. warning: unused variable 'texelBytes'
Signed-off-by: Vinson Lee <[email protected]> --- src/mesa/main/texstore.c | 68 ---------------------------------------------- 1 files changed, 0 insertions(+), 68 deletions(-) diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index bb2fe25..fdacb2e 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -975,12 +975,10 @@ static GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffffffff; - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); GLenum dstType; (void) dims; ASSERT(dstFormat == MESA_FORMAT_Z32 || dstFormat == MESA_FORMAT_Z32_FLOAT); - ASSERT(texelBytes == sizeof(GLuint)); if (dstFormat == MESA_FORMAT_Z32) dstType = GL_UNSIGNED_INT; @@ -1090,10 +1088,8 @@ static GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffff; - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); (void) dims; ASSERT(dstFormat == MESA_FORMAT_Z16); - ASSERT(texelBytes == sizeof(GLushort)); if (ctx->Pixel.DepthScale == 1.0f && ctx->Pixel.DepthBias == 0.0f && @@ -1134,12 +1130,10 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_RGB565 || dstFormat == MESA_FORMAT_RGB565_REV); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1237,14 +1231,12 @@ static GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_RGBA8888 || dstFormat == MESA_FORMAT_RGBA8888_REV || dstFormat == MESA_FORMAT_RGBX8888 || dstFormat == MESA_FORMAT_RGBX8888_REV); - ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1362,14 +1354,12 @@ static GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = GL_RGBA; ASSERT(dstFormat == MESA_FORMAT_ARGB8888 || dstFormat == MESA_FORMAT_ARGB8888_REV || dstFormat == MESA_FORMAT_XRGB8888 || dstFormat == MESA_FORMAT_XRGB8888_REV ); - ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1559,11 +1549,9 @@ static GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_RGB888); - ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1677,11 +1665,9 @@ static GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_BGR888); - ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1775,12 +1761,10 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_ARGB4444 || dstFormat == MESA_FORMAT_ARGB4444_REV); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1840,11 +1824,9 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_RGBA5551); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1893,12 +1875,10 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_ARGB1555 || dstFormat == MESA_FORMAT_ARGB1555_REV); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1959,11 +1939,9 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_argb2101010(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_ARGB2101010); - ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2038,11 +2016,9 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_unorm44(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_AL44); - ASSERT(texelBytes == 1); { /* general path */ @@ -2082,14 +2058,12 @@ static GLboolean _mesa_texstore_unorm88(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_AL88 || dstFormat == MESA_FORMAT_AL88_REV || dstFormat == MESA_FORMAT_GR88 || dstFormat == MESA_FORMAT_RG88); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2199,14 +2173,12 @@ static GLboolean _mesa_texstore_unorm1616(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_AL1616 || dstFormat == MESA_FORMAT_AL1616_REV || dstFormat == MESA_FORMAT_RG1616 || dstFormat == MESA_FORMAT_RG1616_REV); - ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2276,14 +2248,12 @@ static GLboolean _mesa_texstore_unorm16(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_R16 || dstFormat == MESA_FORMAT_A16 || dstFormat == MESA_FORMAT_L16 || dstFormat == MESA_FORMAT_I16); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2333,11 +2303,9 @@ _mesa_texstore_unorm16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_16(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_RGBA_16); - ASSERT(texelBytes == 8); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2468,11 +2436,9 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_RGB332); - ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2521,14 +2487,12 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_unorm8(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_A8 || dstFormat == MESA_FORMAT_L8 || dstFormat == MESA_FORMAT_I8 || dstFormat == MESA_FORMAT_R8); - ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2604,13 +2568,11 @@ static GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); (void) ctx; (void) dims; (void) baseInternalFormat; ASSERT((dstFormat == MESA_FORMAT_YCBCR) || (dstFormat == MESA_FORMAT_YCBCR_REV)); - ASSERT(texelBytes == 2); ASSERT(ctx->Extensions.MESA_ycbcr_texture); ASSERT(srcFormat == GL_YCBCR_MESA); ASSERT((srcType == GL_UNSIGNED_SHORT_8_8_MESA) || @@ -2735,14 +2697,12 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_snorm8(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_A8 || dstFormat == MESA_FORMAT_SIGNED_L8 || dstFormat == MESA_FORMAT_SIGNED_I8 || dstFormat == MESA_FORMAT_SIGNED_R8); - ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2791,12 +2751,10 @@ static GLboolean _mesa_texstore_snorm88(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL88 || dstFormat == MESA_FORMAT_SIGNED_RG88_REV); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2846,14 +2804,12 @@ static GLboolean _mesa_texstore_snorm16(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_R16 || dstFormat == MESA_FORMAT_SIGNED_A16 || dstFormat == MESA_FORMAT_SIGNED_L16 || dstFormat == MESA_FORMAT_SIGNED_I16); - ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2906,12 +2862,10 @@ static GLboolean _mesa_texstore_snorm1616(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL1616 || dstFormat == MESA_FORMAT_SIGNED_GR1616); - ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2966,11 +2920,9 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBX8888); - ASSERT(texelBytes == 4); { /* general path */ @@ -3015,12 +2967,10 @@ static GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBA8888 || dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV); - ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -3315,7 +3265,6 @@ _mesa_texstore_s8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3335,7 +3284,6 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) baseInternalFormat == GL_INTENSITY || baseInternalFormat == GL_RED || baseInternalFormat == GL_RG); - ASSERT(texelBytes == components * sizeof(GLfloat)); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -3386,7 +3334,6 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3406,7 +3353,6 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) baseInternalFormat == GL_INTENSITY || baseInternalFormat == GL_RED || baseInternalFormat == GL_RG); - ASSERT(texelBytes == components * sizeof(GLhalfARB)); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -3456,7 +3402,6 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_int8(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3476,7 +3421,6 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(texelBytes == components * sizeof(GLbyte)); /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply * to integer formats. @@ -3526,7 +3470,6 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_int16(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3546,7 +3489,6 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(texelBytes == components * sizeof(GLshort)); /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply * to integer formats. @@ -3596,7 +3538,6 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_int32(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3616,7 +3557,6 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(texelBytes == components * sizeof(GLint)); /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply * to integer formats. @@ -3666,7 +3606,6 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3686,7 +3625,6 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(texelBytes == components * sizeof(GLubyte)); /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply * to integer formats. @@ -3734,7 +3672,6 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3754,7 +3691,6 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(texelBytes == components * sizeof(GLushort)); /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply * to integer formats. @@ -3802,7 +3738,6 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); @@ -3822,7 +3757,6 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(texelBytes == components * sizeof(GLuint)); /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply * to integer formats. @@ -4147,11 +4081,9 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_argb2101010_uint(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_ARGB2101010_UINT); - ASSERT(texelBytes == 4); if (!srcPacking->SwapBytes && dstFormat == MESA_FORMAT_ARGB2101010_UINT && -- 1.7.7.3 _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
