(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB) &&
srcType == GL_UNSIGNED_BYTE) {
-
int img, row, col;
for (img = 0; img < srcDepth; img++) {
const GLint srcRowStride = _mesa_image_row_stride(srcPacking,
+ dstYoffset * dstRowStride
+ dstXoffset * dstFormat->TexelBytes;
for (row = 0; row < srcHeight; row++) {
+ GLuint *d4 = (GLuint *) dstRow;
for (col = 0; col < srcWidth; col++) {
- dstRow[col * 4 + 0] = srcRow[col * 3 + BCOMP];
- dstRow[col * 4 + 1] = srcRow[col * 3 + GCOMP];
- dstRow[col * 4 + 2] = srcRow[col * 3 + RCOMP];
- dstRow[col * 4 + 3] = 0xff;
+ d4[col] = ((0xff << 24) |
+ (srcRow[col * 3 + RCOMP] << 16) |
+ (srcRow[col * 3 + GCOMP] << 8) |
+ (srcRow[col * 3 + BCOMP] << 0));
}
dstRow += dstRowStride;
srcRow += srcRowStride;
dstFormat == &_mesa_texformat_argb8888 &&
srcFormat == GL_RGBA &&
baseInternalFormat == GL_RGBA &&
- (srcType == GL_UNSIGNED_BYTE && littleEndian)) {
+ srcType == GL_UNSIGNED_BYTE &&
+ littleEndian) {
+ /* same as above case, but src data has alpha too */
GLint img, row, col;
/* For some reason, streaming copies to write-combined regions
* are extremely sensitive to the characteristics of how the
+ dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes
+ dstYoffset * dstRowStride
+ dstXoffset * dstFormat->TexelBytes;
-
for (row = 0; row < srcHeight; row++) {
+ GLuint *d4 = (GLuint *) dstRow;
for (col = 0; col < srcWidth; col++) {
- *(GLuint *)(dstRow + col * 4) = (srcRow[col * 4 + RCOMP] << 16 |
- srcRow[col * 4 + GCOMP] << 8 |
- srcRow[col * 4 + BCOMP] << 0 |
- srcRow[col * 4 + ACOMP] << 24);
+ d4[col] = ((srcRow[col * 4 + ACOMP] << 24) |
+ (srcRow[col * 4 + RCOMP] << 16) |
+ (srcRow[col * 4 + GCOMP] << 8) |
+ (srcRow[col * 4 + BCOMP] << 0));
}
dstRow += dstRowStride;
srcRow += srcRowStride;