Add "Disable culling" as a speedhack for experimentation

Range culling (which we'll just call culling in the setting
name) still is problematic enough that it can be useful to have this
way to turn it off as an escape route. Since disabling it can break some
games like famously TOCA, it needs to be under speedhacks, though likely
the performance change is minimal.

See for example #17061
This commit is contained in:
Henrik Rydgård 2023-12-18 13:11:39 +01:00
parent ef149bd9f3
commit 50bcb2a77a
5 changed files with 13 additions and 1 deletions

View File

@ -602,6 +602,7 @@ static const ConfigSetting graphicsSettings[] = {
ConfigSetting("VendorBugChecksEnabled", &g_Config.bVendorBugChecksEnabled, true, CfgFlag::DONT_SAVE),
ConfigSetting("UseGeometryShader", &g_Config.bUseGeometryShader, false, CfgFlag::PER_GAME),
ConfigSetting("SkipBufferEffects", &g_Config.bSkipBufferEffects, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("DisableRangeCulling", &g_Config.bDisableRangeCulling, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("SoftwareRenderer", &g_Config.bSoftwareRendering, false, CfgFlag::PER_GAME),
ConfigSetting("SoftwareRendererJit", &g_Config.bSoftwareRenderingJit, true, CfgFlag::PER_GAME),
ConfigSetting("HardwareTransform", &g_Config.bHardwareTransform, true, CfgFlag::PER_GAME | CfgFlag::REPORT),

View File

@ -166,6 +166,7 @@ public:
// Speedhacks (more will be moved here):
bool bSkipBufferEffects;
bool bDisableRangeCulling;
int iTexFiltering; // 1 = auto , 2 = nearest , 3 = linear , 4 = auto max quality

View File

@ -603,7 +603,7 @@ u32 GPUCommonHW::CheckGPUFeatures() const {
bool canClipOrCull = draw_->GetDeviceCaps().clipDistanceSupported || draw_->GetDeviceCaps().cullDistanceSupported;
bool canDiscardVertex = !draw_->GetBugs().Has(Draw::Bugs::BROKEN_NAN_IN_CONDITIONAL);
if (canClipOrCull || canDiscardVertex) {
if ((canClipOrCull || canDiscardVertex) && !g_Config.bDisableRangeCulling) {
// We'll dynamically use the parts that are supported, to reduce artifacts as much as possible.
features |= GPU_USE_VS_RANGE_CULLING;
}

View File

@ -410,6 +410,14 @@ void EmuScreen::bootComplete() {
#endif
}
if (g_Config.bStereoRendering) {
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
auto di = GetI18NCategory(I18NCat::DIALOG);
// Stereo rendering is experimental, so let's notify the user it's being used.
// Carefully reuse translations for this rare warning.
g_OSD.Show(OSDType::MESSAGE_WARNING, std::string(gr->T("Stereo rendering")) + ": " + di->T("Enabled"));
}
saveStateSlot_ = SaveState::GetCurrentSlot();
loadingViewColor_->Divert(0x00FFFFFF, 0.2f);

View File

@ -428,6 +428,8 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
});
skipBufferEffects->SetDisabledPtr(&g_Config.bSoftwareRendering);
graphicsSettings->Add(new CheckBox(&g_Config.bDisableRangeCulling, gr->T("Disable culling")));
static const char *skipGpuReadbackModes[] = { "No (default)", "Skip", "Copy to texture" };
PopupMultiChoice *skipGPUReadbacks = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iSkipGPUReadbackMode, gr->T("Skip GPU Readbacks"), skipGpuReadbackModes, 0, ARRAY_SIZE(skipGpuReadbackModes), I18NCat::GRAPHICS, screenManager()));