[Mesa-dev] [PATCH] ac/surface: handle S8 on gfx9
Marek Olšák
maraeo at gmail.com
Mon Sep 18 16:45:05 UTC 2017
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Mon, Sep 18, 2017 at 5:21 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> 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.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/amd/common/ac_surface.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
> index 88cc8a1..850d707 100644
> --- a/src/amd/common/ac_surface.c
> +++ b/src/amd/common/ac_surface.c
> @@ -1138,9 +1138,14 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
>
> /* Calculate texture layout information for stencil. */
> if (surf->flags & RADEON_SURF_SBUFFER) {
> - AddrSurfInfoIn.bpp = 8;
> - AddrSurfInfoIn.flags.depth = 0;
> 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);
> if (r)
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list