diff options
author | Frans Gu <[email protected]> | 2016-07-07 07:08:16 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-03-30 14:44:33 +0200 |
commit | e736edf63dd6b40f459a26f0f95cbe9a834b190a (patch) | |
tree | 375391e2bf57e323e6c8c490051bb4df30f53d5a /src/amd | |
parent | 588e5bbf3d40a5d2537b4e49fbf377ccad953a41 (diff) |
amd/addrlib: Adjust slie size after pitch and actual height adjustment
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/addrlib/r800/egbaddrlib.cpp | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/src/amd/addrlib/r800/egbaddrlib.cpp b/src/amd/addrlib/r800/egbaddrlib.cpp index fe98d2ff25d..0cd27ada070 100644 --- a/src/amd/addrlib/r800/egbaddrlib.cpp +++ b/src/amd/addrlib/r800/egbaddrlib.cpp @@ -285,38 +285,43 @@ BOOL_32 EgBasedLib::ComputeSurfaceInfoLinear( &expHeight, &pOut->heightAlign); - if (pIn->pitchAlign != 0) + if ((pIn->pitchAlign != 0) || (pIn->heightAlign != 0)) { - ADDR_ASSERT((pIn->pitchAlign % pOut->pitchAlign) == 0); - pOut->pitchAlign = pIn->pitchAlign; - - if (IsPow2(pOut->pitchAlign)) - { - expPitch = PowTwoAlign(expPitch, pOut->pitchAlign); - } - else + if (pIn->pitchAlign != 0) { - expPitch += pOut->pitchAlign - 1; - expPitch /= pOut->pitchAlign; - expPitch *= pOut->pitchAlign; - } - } + ADDR_ASSERT((pIn->pitchAlign % pOut->pitchAlign) == 0); + pOut->pitchAlign = pIn->pitchAlign; - if (pIn->heightAlign != 0) - { - ADDR_ASSERT((pIn->heightAlign % pOut->heightAlign) == 0); - pOut->heightAlign = pIn->heightAlign; - - if (IsPow2(pOut->heightAlign)) - { - expHeight = PowTwoAlign(expHeight, pOut->heightAlign); + if (IsPow2(pOut->pitchAlign)) + { + expPitch = PowTwoAlign(expPitch, pOut->pitchAlign); + } + else + { + expPitch += pOut->pitchAlign - 1; + expPitch /= pOut->pitchAlign; + expPitch *= pOut->pitchAlign; + } } - else + + if (pIn->heightAlign != 0) { - expHeight += pOut->heightAlign - 1; - expHeight /= pOut->heightAlign; - expHeight *= pOut->heightAlign; + ADDR_ASSERT((pIn->heightAlign % pOut->heightAlign) == 0); + pOut->heightAlign = pIn->heightAlign; + + if (IsPow2(pOut->heightAlign)) + { + expHeight = PowTwoAlign(expHeight, pOut->heightAlign); + } + else + { + expHeight += pOut->heightAlign - 1; + expHeight /= pOut->heightAlign; + expHeight *= pOut->heightAlign; + } } + + logicalSliceSize = BITS_TO_BYTES(expPitch * expHeight * pIn->bpp); } pOut->pitch = expPitch; |