MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / applyGSHardwareFixes

Method applyGSHardwareFixes

pcsx2/GameDatabase.cpp:700–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698}
699
700void GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& config) const
701{
702 std::string disabled_fixes;
703
704 // Only apply GS HW fixes if the user hasn't manually enabled HW fixes.
705 const bool apply_auto_fixes = !config.ManualUserHacks;
706 const bool is_sw_renderer = EmuConfig.GS.Renderer == GSRendererType::SW;
707 if (!apply_auto_fixes)
708 Console.Warning("GameDB: Manual GS hardware renderer fixes are enabled, not using automatic hardware renderer fixes from GameDB.");
709
710 for (const auto& [id, value] : gsHWFixes)
711 {
712 if (isUserHackHWFix(id) && !apply_auto_fixes)
713 {
714 if (configMatchesHWFix(config, id, value))
715 continue;
716
717 Console.Warning("GameDB: Skipping GS Hardware Fix: %s to [mode=%d]", getHWFixName(id), value);
718 fmt::format_to(std::back_inserter(disabled_fixes), "{} {} = {}", disabled_fixes.empty() ? " " : "\n ", getHWFixName(id), value);
719 continue;
720 }
721
722 switch (id)
723 {
724 case GSHWFixId::AutoFlush:
725 {
726 if (value >= 0 && value <= static_cast<int>(GSHWAutoFlushLevel::Enabled))
727 config.UserHacks_AutoFlush = static_cast<GSHWAutoFlushLevel>(value);
728 }
729 break;
730
731 case GSHWFixId::CPUFramebufferConversion:
732 config.UserHacks_CPUFBConversion = (value > 0);
733 break;
734
735 case GSHWFixId::FlushTCOnClose:
736 config.UserHacks_ReadTCOnClose = (value > 0);
737 break;
738
739 case GSHWFixId::DisableDepthSupport:
740 config.UserHacks_DisableDepthSupport = (value > 0);
741 break;
742
743 case GSHWFixId::PreloadFrameData:
744 config.PreloadFrameWithGSData = (value > 0);
745 break;
746
747 case GSHWFixId::DisablePartialInvalidation:
748 config.UserHacks_DisablePartialInvalidation = (value > 0);
749 break;
750
751 case GSHWFixId::TextureInsideRT:
752 {
753 if (value >= 0 && value <= static_cast<int>(GSTextureInRtMode::MergeTargets))
754 config.UserHacks_TextureInsideRt = static_cast<GSTextureInRtMode>(value);
755 }
756 break;
757

Callers 1

ApplyGameFixesMethod · 0.80

Calls 7

format_toFunction · 0.50
minFunction · 0.50
maxFunction · 0.50
formatFunction · 0.50
WarningMethod · 0.45
emptyMethod · 0.45
WriteLnMethod · 0.45

Tested by

no test coverage detected