mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
gallium/radeon: add depth/stencil_adjusted output to surface computation
This fixes a rare bug with stencil texturing -- seen on Polaris and Tonga, though it's basically a function of the memory configuration so could affect other parts as well. Fixes piglit "unaligned-blit * stencil downsample" and various "fbo-depth-array *stencil*" tests. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
68fe270e71
commit
7000dfd5c3
3 changed files with 14 additions and 2 deletions
|
|
@ -1030,8 +1030,8 @@ r600_texture_create_object(struct pipe_screen *screen,
|
||||||
if (base->flags & (R600_RESOURCE_FLAG_TRANSFER |
|
if (base->flags & (R600_RESOURCE_FLAG_TRANSFER |
|
||||||
R600_RESOURCE_FLAG_FLUSHED_DEPTH) ||
|
R600_RESOURCE_FLAG_FLUSHED_DEPTH) ||
|
||||||
rscreen->chip_class >= EVERGREEN) {
|
rscreen->chip_class >= EVERGREEN) {
|
||||||
rtex->can_sample_z = true;
|
rtex->can_sample_z = !rtex->surface.depth_adjusted;
|
||||||
rtex->can_sample_s = true;
|
rtex->can_sample_s = !rtex->surface.stencil_adjusted;
|
||||||
} else {
|
} else {
|
||||||
if (rtex->resource.b.b.nr_samples <= 1 &&
|
if (rtex->resource.b.b.nr_samples <= 1 &&
|
||||||
(rtex->resource.b.b.format == PIPE_FORMAT_Z16_UNORM ||
|
(rtex->resource.b.b.format == PIPE_FORMAT_Z16_UNORM ||
|
||||||
|
|
|
||||||
|
|
@ -401,6 +401,14 @@ struct radeon_surf {
|
||||||
uint32_t macro_tile_index;
|
uint32_t macro_tile_index;
|
||||||
uint32_t micro_tile_mode; /* displayable, thin, depth, rotated */
|
uint32_t micro_tile_mode; /* displayable, thin, depth, rotated */
|
||||||
|
|
||||||
|
/* Whether the depth miptree or stencil miptree as used by the DB are
|
||||||
|
* adjusted from their TC compatible form to ensure depth/stencil
|
||||||
|
* compatibility. If either is true, the corresponding plane cannot be
|
||||||
|
* sampled from.
|
||||||
|
*/
|
||||||
|
bool depth_adjusted;
|
||||||
|
bool stencil_adjusted;
|
||||||
|
|
||||||
uint64_t dcc_size;
|
uint64_t dcc_size;
|
||||||
uint64_t dcc_alignment;
|
uint64_t dcc_alignment;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -454,6 +454,10 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
/* DB uses the depth pitch for both stencil and depth. */
|
||||||
|
if (surf->stencil_level[level].nblk_x != surf->level[level].nblk_x)
|
||||||
|
surf->stencil_adjusted = true;
|
||||||
|
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
/* For 2D modes only. */
|
/* For 2D modes only. */
|
||||||
if (AddrSurfInfoOut.tileMode >= ADDR_TM_2D_TILED_THIN1) {
|
if (AddrSurfInfoOut.tileMode >= ADDR_TM_2D_TILED_THIN1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue