* conversion and copy:
*/
if (pixels) {
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
if (compressed) {
if (intelImage->mt) {
struct intel_region *dst = intelImage->mt->region;
pixels,
srcRowStride,
0, 0);
- } else
+ }
+ else {
memcpy(texImage->Data, pixels, imageSize);
- } else if (!storeImage(ctx, dims,
- texImage->_BaseFormat,
- texImage->TexFormat,
- texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- texImage->ImageOffsets,
- width, height, depth,
- format, type, pixels, unpack)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ }
+ }
+ else if (!_mesa_texstore(ctx, dims,
+ texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, depth,
+ format, type, pixels, unpack)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
}
}
xoffset, yoffset / 4,
(width + 3) & ~3, (height + 3) / 4,
pixels, (width + 3) & ~3, 0, 0);
- } else
+ }
+ else {
memcpy(texImage->Data, pixels, imageSize);
+ }
}
else {
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
- if (!storeImage(ctx, dims, texImage->_BaseFormat,
- texImage->TexFormat,
- texImage->Data,
- xoffset, yoffset, zoffset,
- dstRowStride,
- texImage->ImageOffsets,
- width, height, depth,
- format, type, pixels, packing)) {
+ if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data,
+ xoffset, yoffset, zoffset,
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, depth,
+ format, type, pixels, packing)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
}
}
} else {
GLuint dstRowStride;
GLuint *dstImageOffsets;
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
if (image->mt) {
radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel];
dstImageOffsets = texImage->ImageOffsets;
}
- if (!storeImage(ctx, dims,
- texImage->_BaseFormat,
- texImage->TexFormat,
- texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- dstImageOffsets,
- width, height, depth,
- format, type, pixels, packing))
+ if (!_mesa_texstore(ctx, dims,
+ texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ dstImageOffsets,
+ width, height, depth,
+ format, type, pixels, packing)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ }
if (dims == 3)
_mesa_free(dstImageOffsets);
copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow);
- } else {
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
- if (!storeImage(ctx, dims, texImage->_BaseFormat,
- texImage->TexFormat, texImage->Data,
- xoffset, yoffset, zoffset,
- dstRowStride,
- texImage->ImageOffsets,
- width, height, depth,
- format, type, pixels, packing))
+ }
+ else {
+ if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat,
+ texImage->TexFormat, texImage->Data,
+ xoffset, yoffset, zoffset,
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, depth,
+ format, type, pixels, packing)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
+ }
}
}
}
if (bpt) {
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
src = _s;
dst = _d;
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, dstImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstWidth * bpt,
- &dstImageOffsets,
- dstWidth, dstHeight, 1,
- GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, dstImage,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstWidth * bpt,
+ &dstImageOffsets,
+ dstWidth, dstHeight, 1,
+ GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking);
FREE(dst);
FREE(src);
}
if (!texImage->IsCompressed) {
GLubyte *destAddr;
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
tempImage = MALLOC(width * height * texelBytes);
if (!tempImage) {
return GL_FALSE;
}
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, tempImage,
- 0, 0, 0, /* dstX/Y/Zoffset */
- width * texelBytes, /* dstRowStride */
- &dstImageOffsets,
- width, height, 1,
- format, type, pixels, packing);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, tempImage,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ width * texelBytes, /* dstRowStride */
+ &dstImageOffsets,
+ width, height, 1,
+ format, type, pixels, packing);
/* now rescale */
/* compute address of dest subimage within the overal tex image */
} else {
const GLint rawBytes = 4;
GLvoid *rawImage = MALLOC(width * height * rawBytes);
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
if (!rawImage) {
return GL_FALSE;
width, height, /* src */
newWidth, newHeight, /* dst */
rawImage /*src*/, tempImage /*dst*/ );
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, texImage->Data,
- xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- &dstImageOffsets,
- newWidth, newHeight, 1,
- GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, texImage->Data,
+ xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ &dstImageOffsets,
+ newWidth, newHeight, 1,
+ GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking);
FREE(rawImage);
}
else {
/* no rescaling needed */
/* unpack image, apply transfer ops and store in texImage->Data */
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, texImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- texImage->ImageOffsets,
- width, height, 1,
- format, type, pixels, packing);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, texImage->Data,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, 1,
+ format, type, pixels, packing);
}
}
}
else {
/* no rescaling needed */
- StoreTexImageFunc storeImage =
- _mesa_get_texstore_func(texImage->TexFormat->MesaFormat);
-
- storeImage(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat, texImage->Data,
- xoffset, yoffset, 0,
- dstRowStride,
- texImage->ImageOffsets,
- width, height, 1,
- format, type, pixels, packing);
+ _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat, texImage->Data,
+ xoffset, yoffset, 0,
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, 1,
+ format, type, pixels, packing);
}
ti->reloadImages = GL_TRUE; /* signal the image needs to be reloaded */