From 12044bd8b0b66fd9e84eed9712ccf3b5c1abd1ee Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 21 Mar 2020 20:34:52 +0300 Subject: [PATCH] rsx: Properly calculate vertex range when divisor is active - The upper bound is to be rounded up, not down. --- rpcs3/Emu/RSX/RSXThread.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 7f623a79aa..f0871d63f6 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -205,9 +205,9 @@ namespace rsx { if (max_index >= attrib.frequency) { - // Actually uses the modulo operator, cannot safely optimize + // Actually uses the modulo operator _min_index = 0; - _max_index = std::max(_max_index, attrib.frequency - 1); + _max_index = attrib.frequency - 1; } else { @@ -219,7 +219,7 @@ namespace rsx { // Division operator _min_index = std::min(_min_index, first / attrib.frequency); - _max_index = std::max(_max_index, max_index / attrib.frequency); + _max_index = std::max(_max_index, aligned_div(max_index, attrib.frequency)); } } }