rasterizer_cache: Handle texture swizzle case with unaligned offsets in same tile. (#23)
This commit is contained in:
@ -308,13 +308,16 @@ static constexpr void MortonCopy(u32 width, u32 height, u32 start_offset, u32 en
|
|||||||
LinearNextTile();
|
LinearNextTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 buffer_end = tiled_offset + aligned_end_offset - aligned_start_offset;
|
// If the copy spans multiple tiles, copy the fully aligned tiles in between.
|
||||||
while (tiled_offset < buffer_end) {
|
if (aligned_start_offset < aligned_end_offset) {
|
||||||
auto linear_data = linear_buffer.subspan(linear_offset, linear_tile_stride);
|
const u32 buffer_end = tiled_offset + aligned_end_offset - aligned_start_offset;
|
||||||
auto tiled_data = tiled_buffer.subspan(tiled_offset, tile_size);
|
while (tiled_offset < buffer_end) {
|
||||||
MortonCopyTile<morton_to_linear, format, converted>(width, tiled_data, linear_data);
|
auto linear_data = linear_buffer.subspan(linear_offset, linear_tile_stride);
|
||||||
tiled_offset += tile_size;
|
auto tiled_data = tiled_buffer.subspan(tiled_offset, tile_size);
|
||||||
LinearNextTile();
|
MortonCopyTile<morton_to_linear, format, converted>(width, tiled_data, linear_data);
|
||||||
|
tiled_offset += tile_size;
|
||||||
|
LinearNextTile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If during a texture download the end coordinate is not tile aligned, swizzle
|
// If during a texture download the end coordinate is not tile aligned, swizzle
|
||||||
|
Reference in New Issue
Block a user