[Mesa-dev] [PATCH] ac/surface: handle error when choosing preferred swizzle mode

Marek Olšák maraeo at gmail.com
Wed Sep 20 22:20:50 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

M.

On Sep 20, 2017 7:47 AM, "Nicolai Hähnle" <nhaehnle at gmail.com> wrote:

From: Nicolai Hähnle <nicolai.haehnle at amd.com>

CID: 1418140
Fixes: c4ac522511d2 ("ac/surface: handle S8 on gfx9")
---
 src/amd/common/ac_surface.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 850d70715e5..22c653f0c4f 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -1134,24 +1134,26 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
        /* Calculate texture layout information. */
        r = gfx9_compute_miptree(addrlib, surf, compressed,
&AddrSurfInfoIn);
        if (r)
                return r;

        /* Calculate texture layout information for stencil. */
        if (surf->flags & RADEON_SURF_SBUFFER) {
                AddrSurfInfoIn.flags.stencil = 1;
                AddrSurfInfoIn.bpp = 8;

-               if (!AddrSurfInfoIn.flags.depth)
+               if (!AddrSurfInfoIn.flags.depth) {
                        r = gfx9_get_preferred_swizzle_mode(addrlib,
&AddrSurfInfoIn, false,

&AddrSurfInfoIn.swizzleMode);
-               else
+                       if (r)
+                               return r;
+               } else
                        AddrSurfInfoIn.flags.depth = 0;

                r = gfx9_compute_miptree(addrlib, surf, compressed,
&AddrSurfInfoIn);
                if (r)
                        return r;
        }

        surf->is_linear = surf->u.gfx9.surf.swizzle_mode == ADDR_SW_LINEAR;

        switch (surf->u.gfx9.surf.swizzle_mode) {
--
2.11.0

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170921/b04faa5c/attachment.html>


More information about the mesa-dev mailing list