mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 08:08:06 +02:00
r600g: fix possible issue with stencil mipmap rendering
Somehow I only hit this issue with my latest libdrm changes.
This won't be needed with DB texturing.
NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 9dfca930d7)
This commit is contained in:
parent
19a15cd5ba
commit
7851d398de
1 changed files with 12 additions and 1 deletions
|
|
@ -1491,13 +1491,24 @@ static void evergreen_init_depth_surface(struct r600_context *rctx,
|
|||
|
||||
if (rtex->surface.flags & RADEON_SURF_SBUFFER) {
|
||||
uint64_t stencil_offset = rtex->surface.stencil_offset;
|
||||
unsigned stile_split = rtex->surface.stencil_tile_split;
|
||||
unsigned i, stile_split = rtex->surface.stencil_tile_split;
|
||||
|
||||
stile_split = eg_tile_split(stile_split);
|
||||
stencil_offset += r600_resource_va(screen, surf->base.texture);
|
||||
stencil_offset += rtex->surface.level[level].offset / 4;
|
||||
stencil_offset >>= 8;
|
||||
|
||||
/* We're guessing the stencil offset from the depth offset.
|
||||
* Make sure each mipmap level has a unique offset. */
|
||||
for (i = 1; i <= level; i++) {
|
||||
/* If two levels have the same address, add 256
|
||||
* to the offset of the smaller level. */
|
||||
if ((rtex->surface.level[i-1].offset / 4) >> 8 ==
|
||||
(rtex->surface.level[i].offset / 4) >> 8) {
|
||||
stencil_offset++;
|
||||
}
|
||||
}
|
||||
|
||||
surf->db_stencil_base = stencil_offset;
|
||||
surf->db_stencil_info = 1 | S_028044_TILE_SPLIT(stile_split);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue