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:
parent
c5a654786b
commit
ee0b6597a9
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue