<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Reviewed-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com" class="">timothy.o.rowley@intel.com</a>>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 17, 2016, at 10:56 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">The minification should happen before alignment, not after. See similar<br class="">
logic on ComputeLODOffsetY. The current logic requires unnecessarily<br class="">
large textures when there's an initial NPOT size.<br class="">
<br class="">
Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>><br class="">
---<br class="">
src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h | 4 ++--<br class="">
1 file changed, 2 insertions(+), 2 deletions(-)<br class="">
<br class="">
diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h<br class="">
index 11ed451..350e44b 100644<br class="">
--- a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h<br class="">
+++ b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h<br class="">
@@ -284,8 +284,8 @@ INLINE void ComputeLODOffset1D(<br class="">
        offset = GFX_ALIGN(curWidth, hAlign);<br class="">
        for (uint32_t l = 1; l < lod; ++l)<br class="">
        {<br class="">
-            curWidth = GFX_ALIGN(std::max<uint32_t>(curWidth >> 1, 1U), hAlign);<br class="">
-            offset += curWidth;<br class="">
+            curWidth = std::max<uint32_t>(curWidth >> 1, 1U);<br class="">
+            offset += GFX_ALIGN(curWidth, hAlign);<br class="">
        }<br class="">
<br class="">
        if (info.isSubsampled || info.isBC)<br class="">
-- <br class="">
2.7.3<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>