summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texcompress_bptc.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2014-11-07 12:20:11 +0100
committerIago Toral Quiroga <itoral@igalia.com>2015-01-12 11:20:29 +0100
commitc540800aa5521023f28eeb288f0d7bb0b67278f3 (patch)
tree8a739adeab1c99aa1da7125b6dc9fd6844c41c86 /src/mesa/main/texcompress_bptc.c
parent4468386a3c8126cf94691c5f0ee12b0b157f314c (diff)
downloadexternal_mesa3d-c540800aa5521023f28eeb288f0d7bb0b67278f3.zip
external_mesa3d-c540800aa5521023f28eeb288f0d7bb0b67278f3.tar.gz
external_mesa3d-c540800aa5521023f28eeb288f0d7bb0b67278f3.tar.bz2
mesa: Remove _mesa_make_temp_float_image
Now that we have _mesa_format_convert we don't need this. This was only used to create temporary RGBA float images in the process of storing some compressed formats. These can call _mesa_texstore with a RGBA/float 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.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/main/texcompress_bptc.c b/src/mesa/main/texcompress_bptc.c
index 3225d96..c944ac2 100644
--- a/src/mesa/main/texcompress_bptc.c
+++ b/src/mesa/main/texcompress_bptc.c
@@ -1587,7 +1587,6 @@ texstore_bptc_rgb_float(TEXSTORE_PARAMS,
{
const float *pixels;
const float *tempImage = NULL;
- GLenum baseFormat;
int rowstride;
if (srcFormat != GL_RGB ||
@@ -1595,16 +1594,19 @@ texstore_bptc_rgb_float(TEXSTORE_PARAMS,
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
/* convert image to RGB/float */
- baseFormat = _mesa_get_format_base_format(dstFormat);
- tempImage = _mesa_make_temp_float_image(ctx, dims,
- baseInternalFormat,
- baseFormat,
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking,
- ctx->_ImageTransferState);
+ GLfloat *tempImageSlices[1];
+ int rgbRowStride = 3 * srcWidth * sizeof(GLfloat);
+ tempImage = malloc(srcWidth * srcHeight * 3 * sizeof(GLfloat));
if (!tempImage)
return GL_FALSE; /* out of memory */
+ tempImageSlices[0] = (GLfloat *) tempImage;
+ _mesa_texstore(ctx, dims,
+ baseInternalFormat,
+ MESA_FORMAT_RGB_FLOAT32,
+ rgbRowStride, (GLubyte **)tempImageSlices,
+ srcWidth, srcHeight, srcDepth,
+ srcFormat, srcType, srcAddr,
+ srcPacking);
pixels = tempImage;
rowstride = srcWidth * sizeof(float) * 3;