/************ DMA BUFFERS **************/
-
-/* Texture related */
-typedef struct _r300_texture_image r300_texture_image;
-
-
-struct _r300_texture_image {
- struct gl_texture_image base;
-
- /**
- * If mt != 0, the image is stored in hardware format in the
- * given mipmap tree. In this case, base.Data may point into the
- * mapping of the buffer object that contains the mipmap tree.
- *
- * If mt == 0, the image is stored in normal memory pointed to
- * by base.Data.
- */
- struct _radeon_mipmap_tree *mt;
- struct radeon_bo *bo;
-
- int mtlevel; /** if mt != 0, this is the image's level in the mipmap tree */
- int mtface; /** if mt != 0, this is the image's face in the mipmap tree */
-};
-
-static INLINE r300_texture_image *get_r300_texture_image(struct gl_texture_image *image)
-{
- return (r300_texture_image*)image;
-}
-
/* The blit width for texture uploads
*/
#define R300_BLIT_WIDTH_BYTES 1024
*/
static struct gl_texture_image *r300NewTextureImage(GLcontext *ctx)
{
- return CALLOC(sizeof(r300_texture_image));
+ return CALLOC(sizeof(radeon_texture_image));
}
/**
*/
static void r300FreeTexImageData(GLcontext *ctx, struct gl_texture_image *timage)
{
- r300_texture_image* image = get_r300_texture_image(timage);
+ radeon_texture_image* image = get_radeon_texture_image(timage);
if (image->mt) {
radeon_miptree_unreference(image->mt);
/* Set Data pointer and additional data for mapped texture image */
-static void teximage_set_map_data(r300_texture_image *image)
+static void teximage_set_map_data(radeon_texture_image *image)
{
radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel];
image->base.Data = image->mt->bo->ptr + lvl->faces[image->mtface].offset;
/**
* Map a single texture image for glTexImage and friends.
*/
-static void r300_teximage_map(r300_texture_image *image, GLboolean write_enable)
+static void r300_teximage_map(radeon_texture_image *image, GLboolean write_enable)
{
if (image->mt) {
assert(!image->base.Data);
}
-static void r300_teximage_unmap(r300_texture_image *image)
+static void r300_teximage_unmap(radeon_texture_image *image)
{
if (image->mt) {
assert(image->base.Data);
radeon_bo_map(t->mt->bo, GL_FALSE);
for(face = 0; face < t->mt->faces; ++face) {
for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level)
- teximage_set_map_data(get_r300_texture_image(texObj->Image[face][level]));
+ teximage_set_map_data(get_radeon_texture_image(texObj->Image[face][level]));
}
}
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
radeonTexObj* t = radeon_tex_obj(texObj);
- r300_texture_image* image = get_r300_texture_image(texImage);
+ radeon_texture_image* image = get_radeon_texture_image(texImage);
R300_FIREVERTICES(rmesa);
int compressed)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
- r300_texture_image* image = get_r300_texture_image(texImage);
+ radeon_texture_image* image = get_radeon_texture_image(texImage);
R300_FIREVERTICES(rmesa);
static void r300_generate_mipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj)
{
GLuint face = face_for_target(target);
- r300_texture_image *baseimage = get_r300_texture_image(texObj->Image[face][texObj->BaseLevel]);
+ radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]);
r300_teximage_map(baseimage, GL_FALSE);
_mesa_generate_mipmap(ctx, target, texObj);
/**
* Ensure that the given image is stored in the given miptree from now on.
*/
-static void migrate_image_to_miptree(radeon_mipmap_tree *mt, r300_texture_image *image, int face, int level)
+static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_image *image, int face, int level)
{
radeon_mipmap_level *dstlvl = &mt->levels[level - mt->firstLevel];
unsigned char *dest;
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
radeonTexObj *t = radeon_tex_obj(texObj);
- r300_texture_image *baseimage = get_r300_texture_image(texObj->Image[0][texObj->BaseLevel]);
+ radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[0][texObj->BaseLevel]);
int face, level;
if (t->validated || t->image_override)
/* Ensure all images are stored in the single main miptree */
for(face = 0; face < t->mt->faces; ++face) {
for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level) {
- r300_texture_image *image = get_r300_texture_image(texObj->Image[face][level]);
+ radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][level]);
if (RADEON_DEBUG & DEBUG_TEXTURE)
fprintf(stderr, " face %i, level %i... ", face, level);
if (t->mt == image->mt) {
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
struct radeon_renderbuffer *rb;
- r300_texture_image *rImage;
+ radeon_texture_image *rImage;
radeonContextPtr radeon;
r300ContextPtr rmesa;
GLframebuffer *fb;
texObj = _mesa_select_tex_object(radeon->glCtx, texUnit, target);
texImage = _mesa_get_tex_image(radeon->glCtx, texObj, target, 0);
- rImage = get_r300_texture_image(texImage);
+ rImage = get_radeon_texture_image(texImage);
t = radeon_tex_obj(texObj);
if (t == NULL) {
return;
void (*emit) (GLcontext *, struct radeon_state_atom *atom);
};
+
+/* Texture related */
+typedef struct _radeon_texture_image radeon_texture_image;
+
+struct _radeon_texture_image {
+ struct gl_texture_image base;
+
+ /**
+ * If mt != 0, the image is stored in hardware format in the
+ * given mipmap tree. In this case, base.Data may point into the
+ * mapping of the buffer object that contains the mipmap tree.
+ *
+ * If mt == 0, the image is stored in normal memory pointed to
+ * by base.Data.
+ */
+ struct _radeon_mipmap_tree *mt;
+ struct radeon_bo *bo;
+
+ int mtlevel; /** if mt != 0, this is the image's level in the mipmap tree */
+ int mtface; /** if mt != 0, this is the image's face in the mipmap tree */
+};
+
+
+static INLINE radeon_texture_image *get_radeon_texture_image(struct gl_texture_image *image)
+{
+ return (radeon_texture_image*)image;
+}
+
+
typedef struct radeon_tex_obj radeonTexObj, *radeonTexObjPtr;
#define RADEON_TXO_MICRO_TILE (1 << 3)