aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-11-17 22:40:29 -0500
committerIlia Mirkin <[email protected]>2016-11-21 21:11:26 -0500
commitee0b6597a9579342029e46bf2bc4a8dd887f7896 (patch)
treec0e4a24b25f0a1018ebdfe46673fa17483f6fe84 /src/gallium/drivers
parentc5a654786b5b68c5c215e3bd1bc83b02d7e2a0e9 (diff)
swr: [rasterizer memory] minify texture width before alignment
The minification should happen before alignment, not after. See similar logic on ComputeLODOffsetY. The current logic requires unnecessarily large textures when there's an initial NPOT size. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
index 11ed4518f2e..350e44b37b5 100644
--- a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
+++ b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
@@ -284,8 +284,8 @@ INLINE void ComputeLODOffset1D(
offset = GFX_ALIGN(curWidth, hAlign);
for (uint32_t l = 1; l < lod; ++l)
{
- curWidth = GFX_ALIGN(std::max<uint32_t>(curWidth >> 1, 1U), hAlign);
- offset += curWidth;
+ curWidth = std::max<uint32_t>(curWidth >> 1, 1U);
+ offset += GFX_ALIGN(curWidth, hAlign);
}
if (info.isSubsampled || info.isBC)