From fdef2f0fd19ac6f2715a802d1e14b8ddfa094f11 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 17 Aug 2017 23:24:00 +0200 Subject: radeonsi/gfx9: properly handle imported textures with unexpected swizzle mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: 17.2 Reviewed-by: Nicolai Hähnle --- src/amd/common/ac_surface.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/amd/common') diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index 823a65d038..610071a956 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -1044,6 +1044,11 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib, case RADEON_SURF_MODE_1D: case RADEON_SURF_MODE_2D: + if (surf->flags & RADEON_SURF_IMPORTED) { + AddrSurfInfoIn.swizzleMode = surf->u.gfx9.surf.swizzle_mode; + break; + } + r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, false, &AddrSurfInfoIn.swizzleMode); if (r) -- cgit v1.2.3