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 <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
This commit is contained in:
Ilia Mirkin 2016-11-17 22:40:29 -05:00
parent c5a654786b
commit ee0b6597a9
1 changed files with 2 additions and 2 deletions

View File

@ -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)