summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-04-02 12:54:52 -0400
committerMarek Olšák <[email protected]>2018-04-10 12:44:41 -0400
commitb64b7125586ce48232658cd860f549a6139b6ddd (patch)
tree9a5bbe5964235ac1f5a7d1309107d85a32885fc4
parent5dd02123a05b9cb5ade38d412609df1062843209 (diff)
ac/surface/gfx9: request desired micro tile mode explicitly
Tested-by: Dieter Nützel <[email protected]>
-rw-r--r--src/amd/common/ac_surface.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 1e1641daeec..b294cd85259 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -814,7 +814,8 @@ static int gfx6_compute_surface(ADDR_HANDLE addrlib,
static int
gfx9_get_preferred_swizzle_mode(ADDR_HANDLE addrlib,
ADDR2_COMPUTE_SURFACE_INFO_INPUT *in,
- bool is_fmask, AddrSwizzleMode *swizzle_mode)
+ bool is_fmask, unsigned flags,
+ AddrSwizzleMode *swizzle_mode)
{
ADDR_E_RETURNCODE ret;
ADDR2_GET_PREFERRED_SURF_SETTING_INPUT sin = {0};
@@ -839,6 +840,13 @@ gfx9_get_preferred_swizzle_mode(ADDR_HANDLE addrlib,
sin.numSamples = in->numSamples;
sin.numFrags = in->numFrags;
+ if (flags & RADEON_SURF_SCANOUT)
+ sin.preferredSwSet.sw_D = 1;
+ else if (in->flags.depth || in->flags.stencil || is_fmask)
+ sin.preferredSwSet.sw_Z = 1;
+ else
+ sin.preferredSwSet.sw_S = 1;
+
if (is_fmask) {
sin.flags.color = 0;
sin.flags.fmask = 1;
@@ -1036,7 +1044,9 @@ static int gfx9_compute_miptree(ADDR_HANDLE addrlib,
fin.size = sizeof(ADDR2_COMPUTE_FMASK_INFO_INPUT);
fout.size = sizeof(ADDR2_COMPUTE_FMASK_INFO_OUTPUT);
- ret = gfx9_get_preferred_swizzle_mode(addrlib, in, true, &fin.swizzleMode);
+ ret = gfx9_get_preferred_swizzle_mode(addrlib, in,
+ true, surf->flags,
+ &fin.swizzleMode);
if (ret != ADDR_OK)
return ret;
@@ -1232,7 +1242,8 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
break;
}
- r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, false,
+ r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn,
+ false, surf->flags,
&AddrSurfInfoIn.swizzleMode);
if (r)
return r;
@@ -1268,7 +1279,8 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
AddrSurfInfoIn.format = ADDR_FMT_8;
if (!AddrSurfInfoIn.flags.depth) {
- r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, false,
+ r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn,
+ false, surf->flags,
&AddrSurfInfoIn.swizzleMode);
if (r)
return r;