_mesa_problem(NULL, "Unexpected logicalBaseFormat");
map[0] = map[1] = 0;
break;
- }
+ }
}
* \param count number of pixels to copy/swizzle.
*/
static void
-swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src,
+swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src,
GLuint srcComponents, const GLubyte *map, GLuint count)
{
GLubyte tmp[8];
switch (dstComponents) {
case 4:
for (i = 0; i < count; i++) {
- COPY_4UBV(tmp, src);
- src += srcComponents;
+ COPY_4UBV(tmp, src);
+ src += srcComponents;
dst[0] = tmp[map[0]];
dst[1] = tmp[map[1]];
dst[2] = tmp[map[2]];
break;
case 3:
for (i = 0; i < count; i++) {
- COPY_4UBV(tmp, src);
- src += srcComponents;
+ COPY_4UBV(tmp, src);
+ src += srcComponents;
dst[0] = tmp[map[0]];
dst[1] = tmp[map[1]];
dst[2] = tmp[map[2]];
break;
case 2:
for (i = 0; i < count; i++) {
- COPY_4UBV(tmp, src);
- src += srcComponents;
+ COPY_4UBV(tmp, src);
+ src += srcComponents;
dst[0] = tmp[map[0]];
dst[1] = tmp[map[1]];
dst += 2;
* Transfer a GLubyte texture image with component swizzling.
*/
static void
-_mesa_swizzle_ubyte_image(GLcontext *ctx,
+_mesa_swizzle_ubyte_image(GLcontext *ctx,
GLuint dimensions,
GLenum srcFormat,
const GLubyte *dstmap, GLint dstComponents,
if (srcRowStride == srcWidth * srcComponents &&
(srcImageStride == srcWidth * srcHeight * srcComponents ||
srcDepth == 1)) {
- swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map,
+ swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map,
srcWidth * srcHeight * srcDepth);
}
else {
* _mesa_texformat_luminance
* _mesa_texformat_luminance_alpha
* _mesa_texformat_intensity
- *
+ *
* \param dims either 1 or 2 or 3
* \param baseInternalFormat user-specified base internal format
* \param dstFormat destination Mesa texture format
#if 0
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- srcType == GL_UNSIGNED_BYTE &&
+ srcType == GL_UNSIGNED_BYTE &&
dstFormat == &_mesa_texformat_rgba8888 &&
littleEndian &&
/* Three texture formats involved: srcFormat,
dstmap[2] = 1;
dstmap[1] = 2;
dstmap[0] = 3;
-
+
_mesa_swizzle_ubyte_image(ctx, dims,
srcFormat,
dstmap, 4,
dstAddr, dstXoffset, dstYoffset, dstZoffset,
dstRowStride, dstImageStride,
srcWidth, srcHeight, srcDepth, srcAddr,
- srcPacking);
+ srcPacking);
}
#endif
else {
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
dstFormat == &_mesa_texformat_argb8888 &&
- srcType == GL_UNSIGNED_BYTE &&
+ srcType == GL_UNSIGNED_BYTE &&
littleEndian &&
/* Three texture formats involved: srcFormat,
* baseInternalFormat and destFormat (GL_RGBA). Only two
dstmap[2] = 0; /* red */
dstmap[1] = 1; /* green */
dstmap[0] = 2; /* blue */
-
+
_mesa_swizzle_ubyte_image(ctx, dims,
srcFormat,
dstmap, 4,
dstAddr, dstXoffset, dstYoffset, dstZoffset,
dstRowStride, dstImageStride,
srcWidth, srcHeight, srcDepth, srcAddr,
- srcPacking);
+ srcPacking);
}
else {
/* general path */