Переглянути джерело

For some reason, streaming copies to write-combined regions are

extremely sensitive to the characteristics of how the source data is
retrieved.  By reordering the source reads in the rgba to bgra
conversion, the speed of this operation increases by half.
tags/texman_0_1_20060325
Keith Whitwell 20 роки тому
джерело
коміт
f565ab2dd5
1 змінених файлів з 37 додано та 0 видалено
  1. 37
    0
      src/mesa/main/texstore.c

+ 37
- 0
src/mesa/main/texstore.c Переглянути файл

@@ -1222,6 +1222,43 @@ _mesa_texstore_argb8888(STORE_PARAMS)
dstImage += dstImageStride;
}
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
dstFormat == &_mesa_texformat_argb8888 &&
srcFormat == GL_RGBA &&
(srcType == GL_UNSIGNED_BYTE && littleEndian)) {

int img, row, col;
GLubyte *dstImage = (GLubyte *) dstAddr
+ dstZoffset * dstImageStride
+ dstYoffset * dstRowStride
+ dstXoffset * dstFormat->TexelBytes;

/* For some reason, streaming copies to write-combined regions
* are extremely sensitive to the characteristics of how the
* source data is retrieved. By reordering the source reads to
* be in-order, the speed of this operation increases by half.
* Strangely the same isn't required for the RGB path, above.
*/
for (img = 0; img < srcDepth; img++) {
const GLint srcRowStride = _mesa_image_row_stride(srcPacking,
srcWidth, srcFormat, srcType);
GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking,
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0);
GLubyte *dstRow = dstImage;
for (row = 0; row < srcHeight; row++) {
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);
}
dstRow += dstRowStride;
srcRow += srcRowStride;
}
dstImage += dstImageStride;
}
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
dstFormat == &_mesa_texformat_argb8888 &&

Завантаження…
Відмінити
Зберегти