summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texcompress_bptc.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2014-11-07 11:17:29 +0100
committerIago Toral Quiroga <itoral@igalia.com>2015-01-12 11:20:29 +0100
commit4468386a3c8126cf94691c5f0ee12b0b157f314c (patch)
tree2abd536a7053c563353f2935ab0d88682061a309 /src/mesa/main/texcompress_bptc.c
parent43a76a9e4416a2ff0b09bb0bc2a39bd4c61148b4 (diff)
downloadexternal_mesa3d-4468386a3c8126cf94691c5f0ee12b0b157f314c.zip
external_mesa3d-4468386a3c8126cf94691c5f0ee12b0b157f314c.tar.gz
external_mesa3d-4468386a3c8126cf94691c5f0ee12b0b157f314c.tar.bz2
mesa: Remove _mesa_make_temp_ubyte_image
Now that we have _mesa_format_convert we don't need this. texstore_rgba will use the GL_COLOR_INDEX to RGBA conversion helpers instead and compressed formats that used _mesa_make_temp_ubyte_image to create an ubyte RGBA temporary image can call _mesa_texstore with a RGBA/ubyte dst to achieve the same goal. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src/mesa/main/texcompress_bptc.c')
-rw-r--r--src/mesa/main/texcompress_bptc.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mesa/main/texcompress_bptc.c b/src/mesa/main/texcompress_bptc.c
index 9204f12..3225d96 100644
--- a/src/mesa/main/texcompress_bptc.c
+++ b/src/mesa/main/texcompress_bptc.c
@@ -1276,7 +1276,6 @@ _mesa_texstore_bptc_rgba_unorm(TEXSTORE_PARAMS)
{
const GLubyte *pixels;
const GLubyte *tempImage = NULL;
- GLenum baseFormat;
int rowstride;
if (srcFormat != GL_RGBA ||
@@ -1284,15 +1283,19 @@ _mesa_texstore_bptc_rgba_unorm(TEXSTORE_PARAMS)
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
/* convert image to RGBA/ubyte */
- baseFormat = _mesa_get_format_base_format(dstFormat);
- tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
- baseInternalFormat,
- baseFormat,
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
+ GLubyte *tempImageSlices[1];
+ int rgbaRowStride = 4 * srcWidth * sizeof(GLubyte);
+ tempImage = malloc(srcWidth * srcHeight * 4 * sizeof(GLubyte));
if (!tempImage)
return GL_FALSE; /* out of memory */
+ tempImageSlices[0] = (GLubyte *) tempImage;
+ _mesa_texstore(ctx, dims,
+ baseInternalFormat,
+ MESA_FORMAT_R8G8B8A8_UNORM,
+ rgbaRowStride, tempImageSlices,
+ srcWidth, srcHeight, srcDepth,
+ srcFormat, srcType, srcAddr,
+ srcPacking);
pixels = tempImage;
rowstride = srcWidth * 4;