summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-26 20:01:13 -0700
committerBrian Paul <[email protected]>2012-01-27 18:21:46 -0700
commit6f55ef3740420924930eb0fc06f7c4979ce0b6dd (patch)
tree1413bdc3abfcae206050775e856b9d78c221f5d0 /src/mesa/main/texstore.c
parent453d4b40bc1dfd4fc1e48c25bda1d293f66597a1 (diff)
mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb332, signed rgba8888, signed rgba888_rev functions. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index d25e410e24a..b22ccd6836d 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -2402,9 +2402,9 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS)
ASSERT(_mesa_get_format_bytes(dstFormat) == 1);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
baseInternalFormat == GL_RGB &&
- srcFormat == GL_RGB && srcType == GL_UNSIGNED_BYTE_3_3_2) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,
@@ -2942,11 +2942,9 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS)
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_SIGNED_RGBA8888 &&
baseInternalFormat == GL_RGBA &&
- ((srcFormat == GL_RGBA && srcType == GL_BYTE && !littleEndian) ||
- (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && littleEndian))) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,
@@ -2954,19 +2952,6 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS)
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
- else if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV &&
- baseInternalFormat == GL_RGBA &&
- ((srcFormat == GL_RGBA && srcType == GL_BYTE && littleEndian) ||
- (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && !littleEndian))) {
- /* simple memcpy path */
- memcpy_texture(ctx, dims,
- dstFormat,
- dstRowStride, dstSlices,
- srcWidth, srcHeight, srcDepth, srcFormat, srcType,
- srcAddr, srcPacking);
- }
else {
/* general path */
const GLfloat *tempImage = _mesa_make_temp_float_image(ctx, dims,