[GPU] Added hack for AC6 floor/ground. Thanks Blackbird88 & TTFH3500

Added to prevent further builds fragmentation.
This will stay until accurate RCP will be implemented.
This commit is contained in:
Gliniak 2023-10-28 10:28:25 +02:00
parent ebdea6b02a
commit a34944e4d2
1 changed files with 14 additions and 1 deletions

View File

@ -19,6 +19,12 @@
#include "xenia/gpu/dxbc_shader_translator.h"
#include "xenia/gpu/render_target_cache.h"
DEFINE_bool(
ac6_ground_fix, false,
"This fixes(hide) issues with black ground in AC6. Use only in AC6. "
"Might cause issues in other titles.",
"HACKS");
namespace xe {
namespace gpu {
using namespace ucode;
@ -84,9 +90,16 @@ void DxbcShaderTranslator::ProcessVertexFetchInstruction(
if (instr.attributes.is_index_rounded) {
a_.OpAdd(address_dest, index_operand, dxbc::Src::LF(0.5f));
a_.OpRoundNI(address_dest, address_src);
} else {
// UGLY HACK. Remove ASAP.
// Proper fix requires accurate RCP implementation.
if (cvars::ac6_ground_fix) {
a_.OpAdd(address_dest, index_operand, dxbc::Src::LF(0.00025f));
a_.OpRoundNI(address_dest, address_src);
} else {
a_.OpRoundNI(address_dest, index_operand);
}
}
if (index_operand_temp_pushed) {
PopSystemTemp();
}