mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
rsx: Fix remainder/iteration computations in BufferUtils
This commit is contained in:
parent
425821863b
commit
a7c28f5827
@ -125,8 +125,13 @@ namespace
|
|||||||
u32 min_block_size = std::min(src_stride, dst_stride);
|
u32 min_block_size = std::min(src_stride, dst_stride);
|
||||||
if (min_block_size == 0) min_block_size = dst_stride;
|
if (min_block_size == 0) min_block_size = dst_stride;
|
||||||
|
|
||||||
const u32 remainder = is_128_aligned? 0: (16 - min_block_size) / min_block_size;
|
u32 iterations = 0;
|
||||||
const u32 iterations = is_128_aligned? vertex_count: vertex_count - remainder;
|
u32 remainder = is_128_aligned ? 0 : 1 + ((16 - min_block_size) / min_block_size);
|
||||||
|
|
||||||
|
if (vertex_count > remainder)
|
||||||
|
iterations = vertex_count - remainder;
|
||||||
|
else
|
||||||
|
remainder = vertex_count;
|
||||||
|
|
||||||
for (u32 i = 0; i < iterations; ++i)
|
for (u32 i = 0; i < iterations; ++i)
|
||||||
{
|
{
|
||||||
@ -168,8 +173,13 @@ namespace
|
|||||||
u32 min_block_size = std::min(src_stride, dst_stride);
|
u32 min_block_size = std::min(src_stride, dst_stride);
|
||||||
if (min_block_size == 0) min_block_size = dst_stride;
|
if (min_block_size == 0) min_block_size = dst_stride;
|
||||||
|
|
||||||
const u32 remainder = is_128_aligned ? 0 : (16 - min_block_size) / min_block_size;
|
u32 iterations = 0;
|
||||||
const u32 iterations = is_128_aligned ? vertex_count : vertex_count - remainder;
|
u32 remainder = is_128_aligned ? 0 : 1 + ((16 - min_block_size) / min_block_size);
|
||||||
|
|
||||||
|
if (vertex_count > remainder)
|
||||||
|
iterations = vertex_count - remainder;
|
||||||
|
else
|
||||||
|
remainder = vertex_count;
|
||||||
|
|
||||||
for (u32 i = 0; i < iterations; ++i)
|
for (u32 i = 0; i < iterations; ++i)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user