mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 19:50:11 +01:00
ac/surface: handle S8 on gfx9
If we don't have a depth piece, we don't get a correct swizzle mode and we hit an assert in addrlib. In case of no depth get the preferrred swizzle mode for stencil alone. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Cc: "17.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
39d539e321
commit
c4ac522511
1 changed files with 7 additions and 2 deletions
|
|
@ -1138,9 +1138,14 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
|
||||||
|
|
||||||
/* Calculate texture layout information for stencil. */
|
/* Calculate texture layout information for stencil. */
|
||||||
if (surf->flags & RADEON_SURF_SBUFFER) {
|
if (surf->flags & RADEON_SURF_SBUFFER) {
|
||||||
AddrSurfInfoIn.bpp = 8;
|
|
||||||
AddrSurfInfoIn.flags.depth = 0;
|
|
||||||
AddrSurfInfoIn.flags.stencil = 1;
|
AddrSurfInfoIn.flags.stencil = 1;
|
||||||
|
AddrSurfInfoIn.bpp = 8;
|
||||||
|
|
||||||
|
if (!AddrSurfInfoIn.flags.depth)
|
||||||
|
r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, false,
|
||||||
|
&AddrSurfInfoIn.swizzleMode);
|
||||||
|
else
|
||||||
|
AddrSurfInfoIn.flags.depth = 0;
|
||||||
|
|
||||||
r = gfx9_compute_miptree(addrlib, surf, compressed, &AddrSurfInfoIn);
|
r = gfx9_compute_miptree(addrlib, surf, compressed, &AddrSurfInfoIn);
|
||||||
if (r)
|
if (r)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue