aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorXavi Zhang <[email protected]>2016-02-26 02:49:28 -0500
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commit4dd4700612adf7cb089eb667f265b7c55fd6fd7c (patch)
treea7548ff3cf148bb353af2c41bd576f94c0dfa711 /src/amd
parenteb3036ed46d97d43728626207b423fdc9c09e3d7 (diff)
amdgpu/addrlib: Always returns pixelPitch in original pixels
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/addrlib/core/addrlib1.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp
index 34e286e4dd3..d65fd0228bc 100644
--- a/src/amd/addrlib/core/addrlib1.cpp
+++ b/src/amd/addrlib/core/addrlib1.cpp
@@ -381,21 +381,17 @@ ADDR_E_RETURNCODE Lib::ComputeSurfaceInfo(
if (localIn.format != ADDR_FMT_INVALID)
{
//
- // 96 bits surface of level 1+ requires element pitch of 32 bits instead
- // In hwl function we skip multiplication of 3 then we should skip division of 3
- // We keep pitch that represents 32 bit element instead of 96 bits since we
- // will get an odd number if divided by 3.
+ // Note: For 96 bit surface, the pixelPitch returned might be an odd number, but it
+ // is okay to program texture pitch as HW's mip calculator would multiply 3 first,
+ // then do the appropriate paddings (linear alignment requirement and possible the
+ // nearest power-of-two for mipmaps), which results in the original pitch.
//
- if (!((expandX == 3) && (localIn.mipLevel > 0)))
- {
-
- GetElemLib()->RestoreSurfaceInfo(elemMode,
- expandX,
- expandY,
- &localIn.bpp,
- &pOut->pixelPitch,
- &pOut->pixelHeight);
- }
+ GetElemLib()->RestoreSurfaceInfo(elemMode,
+ expandX,
+ expandY,
+ &localIn.bpp,
+ &pOut->pixelPitch,
+ &pOut->pixelHeight);
}
if (localIn.flags.qbStereo)