To indicate that it points to mapped texture memory.
DBG("%s \n", __FUNCTION__);
- intel_image->base.Data = intel_region_map(intel, mt->region, mode);
+ intel_image->base.Map = intel_region_map(intel, mt->region, mode);
} else {
assert(intel_image->base.Base.Depth == 1);
intel_miptree_get_image_offset(mt, level, face, 0, &x, &y);
DBG("%s: (%d,%d) -> (%d, %d)/%d\n",
__FUNCTION__, face, level, x, y, mt->region->pitch * mt->cpp);
- intel_image->base.Data = intel_region_map(intel, mt->region, mode) +
+ intel_image->base.Map = intel_region_map(intel, mt->region, mode) +
(x + y * mt->region->pitch) * mt->cpp;
}
{
if (intel_image && intel_image->mt) {
intel_region_unmap(intel, intel_image->mt->region);
- intel_image->base.Data = NULL;
+ intel_image->base.Map = NULL;
}
}
nti->transfer.x = x;
nti->transfer.y = y;
- nti->base.Data = nouveau_get_scratch(ctx, st->pitch * h,
+ nti->base.Map = nouveau_get_scratch(ctx, st->pitch * h,
&st->bo, &st->offset);
} else {
assert(!ret);
}
- nti->base.Data = s->bo->map + y * s->pitch + x * s->cpp;
+ nti->base.Map = s->bo->map + y * s->pitch + x * s->cpp;
}
}
}
nouveau_bo_unmap(s->bo);
}
- nti->base.Data = NULL;
+ nti->base.Map = NULL;
}
*stride = s->pitch;
}
} else {
- *map = nti->base.Data + y * s->pitch + x * s->cpp;
+ *map = nti->base.Map + y * s->pitch + x * s->cpp;
*stride = s->pitch;
}
}
nouveau_bo_unmap(s->bo);
}
- nti->base.Data = NULL;
+ nti->base.Map = NULL;
}
static gl_format
ret = _mesa_texstore(ctx, dims, ti->_BaseFormat,
ti->TexFormat,
s->pitch,
- &nti->base.Data,
+ &nti->base.Map,
width, height, depth,
format, type, pixels, packing);
assert(ret);
ret = _mesa_texstore(ctx, 3, ti->_BaseFormat, ti->TexFormat,
s->pitch,
- &nti->base.Data,
+ &nti->base.Map,
width, height, depth,
format, type, pixels, packing);
assert(ret);
radeon_bo_unmap(image->mt->bo);
radeon_miptree_unreference(&image->mt);
- } else if (image->base.Data) {
+ } else if (image->base.Map) {
/* This condition should be removed, it's here to workaround
* a segfault when mapping textures during software fallbacks.
*/
rows = (rows + blockHeight - 1) / blockHeight;
}
- copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride,
+ copy_rows(dest, dstlvl->rowstride, image->base.Map, srcrowstride,
rows, srcrowstride);
- _mesa_align_free(image->base.Data);
- image->base.Data = 0;
+ _mesa_align_free(image->base.Map);
+ image->base.Map = 0;
}
radeon_bo_unmap(mt->bo);
lvl = &image->mt->levels[image->base.Base.Level];
- image->base.Data = image->mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
+ image->base.Map = image->mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
image->base.RowStride = lvl->rowstride / _mesa_get_format_bytes(image->base.Base.TexFormat);
}
__func__, image,
write_enable ? "true": "false");
if (image->mt) {
- assert(!image->base.Data);
+ assert(!image->base.Map);
radeon_bo_map(image->mt->bo, write_enable);
teximage_set_map_data(image);
"%s(img %p)\n",
__func__, image);
if (image->mt) {
- assert(image->base.Data);
+ assert(image->base.Map);
- image->base.Data = 0;
+ image->base.Map = 0;
radeon_bo_unmap(image->mt->bo);
}
}
radeon_bo_map(mt->bo, 1);
- image->base.Data = mt->bo->ptr + lvl->faces[face].offset;
+ image->base.Map = mt->bo->ptr + lvl->faces[face].offset;
if (mt->target == GL_TEXTURE_3D) {
int i;
radeon_texture_image *image)
{
if (image && image->mt) {
- image->base.Data = NULL;
+ image->base.Map = NULL;
radeon_bo_unmap(image->mt->bo);
}
}
_mesa_init_teximage_fields(&dri_ctx->Base, texImage,
w, h, 1, 0, internalFormat, texFormat);
- sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)swImage->Data,
+ sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)swImage->Buffer,
dPriv->loaderPrivate);
_mesa_unlock_texture(&dri_ctx->Base, texObj);
/* setup dummy texture image info */
memset(&texImage, 0, sizeof(texImage));
- texImage.Data = (void *) src;
+ texImage.Map = (void *) src;
texImage.RowStride = srcRowStride;
switch (format) {
GLubyte dst[3];
const GLubyte *src;
- src = (const GLubyte *) texImage->Data +
+ src = (const GLubyte *) texImage->Map +
(((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8;
etc1_parse_block(&block, src);
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
(void) k;
- fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, rgba);
+ fxt1_decode_1(texImage->Map, texImage->RowStride, i, j, rgba);
texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
(void) k;
- fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, rgba);
+ fxt1_decode_1(texImage->Map, texImage->RowStride, i, j, rgba);
texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLubyte red;
- unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Data,
+ unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Map,
i, j, &red, 1);
texel[RCOMP] = UBYTE_TO_FLOAT(red);
texel[GCOMP] = 0.0;
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLbyte red;
- signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Data),
+ signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Map),
i, j, &red, 1);
texel[RCOMP] = BYTE_TO_FLOAT_TEX(red);
texel[GCOMP] = 0.0;
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLubyte red, green;
- unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Data,
+ unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Map,
i, j, &red, 2);
- unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Data + 8,
+ unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Map + 8,
i, j, &green, 2);
texel[RCOMP] = UBYTE_TO_FLOAT(red);
texel[GCOMP] = UBYTE_TO_FLOAT(green);
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLbyte red, green;
- signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Data),
+ signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Map),
i, j, &red, 2);
- signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Data) + 8,
+ signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Map) + 8,
i, j, &green, 2);
texel[RCOMP] = BYTE_TO_FLOAT_TEX(red);
texel[GCOMP] = BYTE_TO_FLOAT_TEX(green);
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLubyte red;
- unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Data,
+ unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Map,
i, j, &red, 1);
texel[RCOMP] =
texel[GCOMP] =
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLbyte red;
- signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Data),
+ signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Map),
i, j, &red, 1);
texel[RCOMP] =
texel[GCOMP] =
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLubyte red, green;
- unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Data,
+ unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Map,
i, j, &red, 2);
- unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Data + 8,
+ unsigned_fetch_texel_rgtc(texImage->RowStride, texImage->Map + 8,
i, j, &green, 2);
texel[RCOMP] =
texel[GCOMP] =
GLint i, GLint j, GLint k, GLfloat *texel)
{
GLbyte red, green;
- signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Data),
+ signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Map),
i, j, &red, 2);
- signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Data) + 8,
+ signed_fetch_texel_rgtc(texImage->RowStride, (GLbyte *)(texImage->Map) + 8,
i, j, &green, 2);
texel[RCOMP] =
texel[GCOMP] =
(void) k;
if (fetch_ext_rgb_dxt1) {
fetch_ext_rgb_dxt1(texImage->RowStride,
- texImage->Data, i, j, texel);
+ texImage->Map, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgb_dxt1");
(void) k;
if (fetch_ext_rgba_dxt1) {
fetch_ext_rgba_dxt1(texImage->RowStride,
- texImage->Data, i, j, texel);
+ texImage->Map, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt1\n");
(void) k;
if (fetch_ext_rgba_dxt3) {
fetch_ext_rgba_dxt3(texImage->RowStride,
- texImage->Data, i, j, texel);
+ texImage->Map, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt3\n");
(void) k;
if (fetch_ext_rgba_dxt5) {
fetch_ext_rgba_dxt5(texImage->RowStride,
- texImage->Data, i, j, texel);
+ texImage->Map, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt5\n");
GLint RowStride; /**< Padded width in units of texels */
GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to
each 2D slice in 'Data', in texels */
- GLubyte *Data; /**< Image data, accessed via FetchTexel() */
+ GLubyte *Map; /**< Pointer to mapped image memory */
/** Malloc'd texture memory */
GLubyte *Buffer;
#if DIM == 1
#define TEXEL_ADDR( type, image, i, j, k, size ) \
- ((void) (j), (void) (k), ((type *)(image)->Data + (i) * (size)))
+ ((void) (j), (void) (k), ((type *)(image)->Map + (i) * (size)))
#define FETCH(x) fetch_texel_1d_##x
#define TEXEL_ADDR( type, image, i, j, k, size ) \
((void) (k), \
- ((type *)(image)->Data + ((image)->RowStride * (j) + (i)) * (size)))
+ ((type *)(image)->Map + ((image)->RowStride * (j) + (i)) * (size)))
#define FETCH(x) fetch_texel_2d_##x
#elif DIM == 3
#define TEXEL_ADDR( type, image, i, j, k, size ) \
- ((type *)(image)->Data + ((image)->ImageOffsets[k] \
+ ((type *)(image)->Map + ((image)->ImageOffsets[k] \
+ (image)->RowStride * (j) + (i)) * (size))
#define FETCH(x) fetch_texel_3d_##x
GLint i = IFLOOR(texcoords[k][0] * width) & colMask;
GLint j = IFLOOR(texcoords[k][1] * height) & rowMask;
GLint pos = (j << shift) | i;
- GLubyte *texel = swImg->Data + 3 * pos;
+ GLubyte *texel = swImg->Map + 3 * pos;
rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[2]);
rgba[k][GCOMP] = UBYTE_TO_FLOAT(texel[1]);
rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[0]);
const GLint col = IFLOOR(texcoords[i][0] * width) & colMask;
const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask;
const GLint pos = (row << shift) | col;
- const GLuint texel = *((GLuint *) swImg->Data + pos);
+ const GLuint texel = *((GLuint *) swImg->Map + pos);
rgba[i][RCOMP] = UBYTE_TO_FLOAT( (texel >> 24) );
rgba[i][GCOMP] = UBYTE_TO_FLOAT( (texel >> 16) & 0xff );
rgba[i][BCOMP] = UBYTE_TO_FLOAT( (texel >> 8) & 0xff );
swrast_texture_image(texImage);
/* XXX we'll eventually call _swrast_map_teximage() here */
- swImage->Data = swImage->Buffer;
+ swImage->Map = swImage->Buffer;
}
}
}
= swrast_texture_image(texImage);
/* XXX we'll eventually call _swrast_unmap_teximage() here */
- swImage->Data = NULL;
+ swImage->Map = NULL;
}
}
}
if (map) {
/* XXX we'll eventually call _swrast_map_teximage() here */
- swImage->Data = swImage->Buffer;
+ swImage->Map = swImage->Buffer;
}
else {
/* XXX we'll eventually call _swrast_unmap_teximage() here */
- swImage->Data = NULL;
+ swImage->Map = NULL;
}
}
}
const GLfloat twidth = (GLfloat) texImg->Width; \
const GLfloat theight = (GLfloat) texImg->Height; \
const GLint twidth_log2 = texImg->WidthLog2; \
- const GLubyte *texture = (const GLubyte *) swImg->Data; \
+ const GLubyte *texture = (const GLubyte *) swImg->Map; \
const GLint smask = texImg->Width - 1; \
const GLint tmask = texImg->Height - 1; \
ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
const GLfloat twidth = (GLfloat) texImg->Width; \
const GLfloat theight = (GLfloat) texImg->Height; \
const GLint twidth_log2 = texImg->WidthLog2; \
- const GLubyte *texture = (const GLubyte *) swImg->Data; \
+ const GLubyte *texture = (const GLubyte *) swImg->Map; \
const GLint smask = texImg->Width - 1; \
const GLint tmask = texImg->Height - 1; \
ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
swrast_texture_image_const(texImg); \
const GLfloat twidth = (GLfloat) texImg->Width; \
const GLfloat theight = (GLfloat) texImg->Height; \
- info.texture = (const GLchan *) swImg->Data; \
+ info.texture = (const GLchan *) swImg->Map; \
info.twidth_log2 = texImg->WidthLog2; \
info.smask = texImg->Width - 1; \
info.tmask = texImg->Height - 1; \
obj->Image[0][obj->BaseLevel]; \
const struct swrast_texture_image *swImg = \
swrast_texture_image_const(texImg); \
- info.texture = (const GLchan *) swImg->Data; \
+ info.texture = (const GLchan *) swImg->Map; \
info.twidth_log2 = texImg->WidthLog2; \
info.smask = texImg->Width - 1; \
info.tmask = texImg->Height - 1; \