ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_RGBA5551 &&
baseInternalFormat == GL_RGBA &&
- srcFormat == GL_RGBA &&
- srcType == GL_UNSIGNED_SHORT_5_5_5_1) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,
ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_ARGB1555 &&
baseInternalFormat == GL_RGBA &&
- srcFormat == GL_BGRA &&
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_ARGB2101010 &&
- srcFormat == GL_BGRA &&
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV &&
- baseInternalFormat == GL_RGBA) {
+ baseInternalFormat == GL_RGBA &&
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,