diff --git a/src/xenia/gpu/dxbc_shader_translator_fetch.cc b/src/xenia/gpu/dxbc_shader_translator_fetch.cc index 7716c4a26..3c345778b 100644 --- a/src/xenia/gpu/dxbc_shader_translator_fetch.cc +++ b/src/xenia/gpu/dxbc_shader_translator_fetch.cc @@ -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; @@ -85,7 +91,14 @@ void DxbcShaderTranslator::ProcessVertexFetchInstruction( a_.OpAdd(address_dest, index_operand, dxbc::Src::LF(0.5f)); a_.OpRoundNI(address_dest, address_src); } else { - a_.OpRoundNI(address_dest, index_operand); + // 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();