diff options
Diffstat (limited to 'src/amd/addrlib/r800')
-rw-r--r-- | src/amd/addrlib/r800/egbaddrlib.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/amd/addrlib/r800/egbaddrlib.cpp b/src/amd/addrlib/r800/egbaddrlib.cpp index abd1a79ed80..5d80906aea3 100644 --- a/src/amd/addrlib/r800/egbaddrlib.cpp +++ b/src/amd/addrlib/r800/egbaddrlib.cpp @@ -1158,6 +1158,22 @@ BOOL_32 EgBasedAddrLib::HwlDegradeBaseLevel( if (valid) { degrade = (pIn->width < pitchAlign || pIn->height < heightAlign); + // Check whether 2D tiling still has too much footprint + if (degrade == FALSE) + { + // Only check width and height as slices are aligned to thickness + UINT_64 unalignedSize = pIn->width * pIn->height; + + UINT_32 alignedPitch = PowTwoAlign(pIn->width, pitchAlign); + UINT_32 alignedHeight = PowTwoAlign(pIn->height, heightAlign); + UINT_64 alignedSize = alignedPitch * alignedHeight; + + // alignedSize > 1.5 * unalignedSize + if (2 * alignedSize > 3 * unalignedSize) + { + degrade = TRUE; + } + } } else { |