radeon/fbo: use correct depth texture offset for depth textures
This commit is contained in:
parent
defd45e95e
commit
7c6f51cdcc
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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_ */
|
||||
|
|
Loading…
Reference in New Issue