radeon/fbo: use correct depth texture offset for depth textures

This commit is contained in:
Andre Maasikas 2010-01-04 09:26:46 +02:00
parent defd45e95e
commit 7c6f51cdcc
3 changed files with 4 additions and 26 deletions

View File

@ -531,10 +531,9 @@ radeon_render_texture(GLcontext * ctx,
att->TextureLevel);
if (att->Texture->Target == GL_TEXTURE_3D) {
GLuint offsets[6];
radeon_miptree_depth_offsets(radeon_image->mt, att->TextureLevel,
offsets);
imageOffset += offsets[att->Zoffset];
imageOffset += radeon_image->mt->levels[att->TextureLevel].rowstride *
radeon_image->mt->levels[att->TextureLevel].height *
att->Zoffset;
}
/* store that offset in the region, along with the correct pitch for

View File

@ -380,25 +380,6 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t)
texImg->Depth, t->tile_bits);
}
/* Although we use the image_offset[] array to store relative offsets
* to cube faces, Mesa doesn't know anything about this and expects
* each cube face to be treated as a separate image.
*
* These functions present that view to mesa:
*/
void
radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets)
{
if (mt->target != GL_TEXTURE_3D || mt->faces == 1) {
offsets[0] = 0;
} else {
int i;
for (i = 0; i < 6; i++) {
offsets[i] = mt->levels[level].faces[i].offset;
}
}
}
GLuint
radeon_miptree_image_offset(radeon_mipmap_tree *mt,
GLuint face, GLuint level)
@ -619,4 +600,4 @@ uint32_t get_base_teximage_offset(radeonTexObj *texObj)
} else {
return radeon_miptree_image_offset(texObj->mt, 0, texObj->minLod);
}
}
}

View File

@ -88,7 +88,5 @@ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt,
void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t);
GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt,
GLuint face, GLuint level);
void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets);
uint32_t get_base_teximage_offset(radeonTexObj *texObj);
#endif /* __RADEON_MIPMAP_TREE_H_ */