summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_texture.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-10-23 10:44:47 -0600
committerBrian Paul <brianp@vmware.com>2011-10-23 10:44:47 -0600
commit68da4b50e9b6aa72a9b155f650952620063e1b94 (patch)
tree369f3d98b315e6a000f3d45ad96b006aebc310e0 /src/mesa/drivers/dri/radeon/radeon_texture.c
parent66681b4c8cb1ef16f42c1591298cb30c83bca09b (diff)
downloadexternal_mesa3d-68da4b50e9b6aa72a9b155f650952620063e1b94.zip
external_mesa3d-68da4b50e9b6aa72a9b155f650952620063e1b94.tar.gz
external_mesa3d-68da4b50e9b6aa72a9b155f650952620063e1b94.tar.bz2
mesa: add swrast_texture_image::Buffer
In the past, swrast_texture_image::Data has been overloaded. It could either point to malloc'd memory storing texture data, or it could point to a current mapping of GPU memory. Now, Buffer always points to malloc'd memory (if we're not using GPU memory) and Data always points to mapped memory. The next step would be to rename Data -> Map. This change also involves adding swrast functions for mapping textures and renderbuffers prior to rendering to setup the Data pointer. Plus, corresponding functions to unmap texures and renderbuffers. This is very much like similar code in the dri drivers.
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_texture.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index abe7510..4f8daa7 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -104,7 +104,7 @@ void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_imag
if (image->mt) {
radeon_miptree_unreference(&image->mt);
- assert(!image->base.Data);
+ assert(!image->base.Buffer);
} else {
_swrast_free_texture_image_buffer(ctx, timage);
}
@@ -112,9 +112,9 @@ void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_imag
radeon_bo_unref(image->bo);
image->bo = NULL;
}
- if (image->base.Data) {
- _mesa_align_free(image->base.Data);
- image->base.Data = NULL;
+ if (image->base.Buffer) {
+ _mesa_align_free(image->base.Buffer);
+ image->base.Buffer = NULL;
}
if (image->base.ImageOffsets) {
@@ -314,7 +314,7 @@ radeon_map_texture_image(struct gl_context *ctx,
assert(map);
*stride = _mesa_format_row_stride(texImage->TexFormat, width);
- *map = image->base.Data + (slice * height) * *stride;
+ *map = image->base.Buffer + (slice * height) * *stride;
}
*map += y * *stride + x * texel_size;
@@ -828,12 +828,12 @@ static void radeon_teximage(
texImage->Width,
texImage->Height,
texImage->Depth);
- image->base.Data = _mesa_align_malloc(size, 512);
+ image->base.Buffer = _mesa_align_malloc(size, 512);
radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
"%s %dd: texObj %p, texImage %p, "
" no miptree assigned, using local memory %p\n",
- __func__, dims, texObj, texImage, image->base.Data);
+ __func__, dims, texObj, texImage, image->base.Buffer);
}
}