GameDatabase: Turn PGXPPreserveProjFP into a boolean setting

wip5
Stenzek 2 weeks ago
parent e688e24eb9
commit 5bd1a492be
No known key found for this signature in database

@ -21455,8 +21455,8 @@ SCES-02105:
- DigitalController
- NeGcon
- JogCon
traits:
- DisablePGXPPreserveProjFP
settings:
gpuPGXPPreserveProjFP: false # Causes holes in geometry.
libcrypt: true
metadata:
publisher: "Sony"
@ -21487,8 +21487,8 @@ SCUS-94426:
- DigitalController
- NeGcon
- JogCon
traits:
- DisablePGXPPreserveProjFP
settings:
gpuPGXPPreserveProjFP: false # Causes holes in geometry.
metadata:
publisher: "Sony"
developer: "Naughty Dog"
@ -21507,8 +21507,8 @@ SCUS-94459:
name: "CTR - Crash Team Racing (USA) (Demo)"
metadata:
genre: "** DEMO **"
traits:
- DisablePGXPPreserveProjFP
settings:
gpuPGXPPreserveProjFP: false # Causes holes in geometry.
SLUS-01391:
name: "Cabela's Big Game Hunter - Ultimate Challenge (USA)"
controllers:
@ -30751,8 +30751,8 @@ SCPS-45470:
- AnalogController
- DigitalController
- NeGcon
traits:
- DisablePGXPPreserveProjFP
settings:
gpuPGXPPreserveProjFP: false # Causes holes in geometry.
metadata:
publisher: "Sony"
developer: "Naughty Dog"
@ -30773,8 +30773,8 @@ SCPS-10118:
- AnalogController
- DigitalController
- NeGcon
traits:
- DisablePGXPPreserveProjFP
settings:
gpuPGXPPreserveProjFP: false # Causes holes in geometry.
codes:
- SCPS-10118
- SCPS-91328
@ -30796,16 +30796,16 @@ PCPX-96183:
name: "Crash Bandicoot Racing (Japan) (Demo)"
metadata:
genre: "** DEMO **"
traits:
- DisablePGXPPreserveProjFP
settings:
gpuPGXPPreserveProjFP: false # Causes holes in geometry.
SCPS-91230:
name: "Crash Bandicoot Racing [Playstation the Best for Family]"
controllers:
- AnalogController
- DigitalController
- NeGcon
traits:
- DisablePGXPPreserveProjFP
settings:
gpuPGXPPreserveProjFP: false # Causes holes in geometry.
metadata:
publisher: "Sony"
developer: "Naughty Dog"

@ -40,7 +40,7 @@ namespace GameDatabase {
enum : u32
{
GAME_DATABASE_CACHE_SIGNATURE = 0x45434C48,
GAME_DATABASE_CACHE_VERSION = 20,
GAME_DATABASE_CACHE_VERSION = 21,
};
static const Entry* GetEntryForId(std::string_view code);
@ -95,7 +95,6 @@ static constexpr const std::array<const char*, static_cast<size_t>(Trait::MaxCou
"DisablePGXPTextureCorrection",
"DisablePGXPColorCorrection",
"DisablePGXPDepthBuffer",
"DisablePGXPPreserveProjFP",
"DisablePGXPOn2DPolygons",
"ForcePGXPVertexCache",
"ForcePGXPCPUMode",
@ -125,7 +124,6 @@ static constexpr const std::array<const char*, static_cast<size_t>(Trait::MaxCou
TRANSLATE_DISAMBIG_NOOP("GameDatabase", "Disable PGXP Texture Correction", "GameDatabase::Trait"),
TRANSLATE_DISAMBIG_NOOP("GameDatabase", "Disable PGXP Color Correction", "GameDatabase::Trait"),
TRANSLATE_DISAMBIG_NOOP("GameDatabase", "Disable PGXP Depth Buffer", "GameDatabase::Trait"),
TRANSLATE_DISAMBIG_NOOP("GameDatabase", "Disable PGXP Preserve Projection Floating Point", "GameDatabase::Trait"),
TRANSLATE_DISAMBIG_NOOP("GameDatabase", "Disable PGXP on 2D Polygons", "GameDatabase::Trait"),
TRANSLATE_DISAMBIG_NOOP("GameDatabase", "Force PGXP Vertex Cache", "GameDatabase::Trait"),
TRANSLATE_DISAMBIG_NOOP("GameDatabase", "Force PGXP CPU Mode", "GameDatabase::Trait"),
@ -616,14 +614,6 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
settings.gpu_pgxp_color_correction = false;
}
if (HasTrait(Trait::DisablePGXPPreserveProjFP))
{
if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_preserve_proj_fp)
APPEND_MESSAGE(TRANSLATE_SV("GameDatabase", "PGXP preserve projection precision disabled."));
settings.gpu_pgxp_preserve_proj_fp = false;
}
if (HasTrait(Trait::ForcePGXPVertexCache))
{
if (display_osd_messages && settings.gpu_pgxp_enable && !settings.gpu_pgxp_vertex_cache)
@ -682,6 +672,20 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
g_settings.gpu_pgxp_disable_2d = true;
}
if (gpu_pgxp_preserve_proj_fp.has_value())
{
if (display_osd_messages)
{
INFO_LOG("GameDB: GPU preserve projection precision set to {}.",
gpu_pgxp_preserve_proj_fp.value() ? "true" : "false");
if (settings.gpu_pgxp_enable && settings.gpu_pgxp_preserve_proj_fp && !gpu_pgxp_preserve_proj_fp.value())
APPEND_MESSAGE(TRANSLATE_SV("GameDatabase", "PGXP preserve projection precision disabled."));
}
settings.gpu_pgxp_preserve_proj_fp = gpu_pgxp_preserve_proj_fp.value();
}
if (HasTrait(Trait::ForceRecompilerICache))
{
WARNING_LOG("ICache for recompiler forced by compatibility settings.");
@ -955,7 +959,8 @@ bool GameDatabase::LoadFromCache()
!reader.ReadOptionalT(&entry.display_deinterlacing_mode) || !reader.ReadOptionalT(&entry.dma_max_slice_ticks) ||
!reader.ReadOptionalT(&entry.dma_halt_ticks) || !reader.ReadOptionalT(&entry.gpu_fifo_size) ||
!reader.ReadOptionalT(&entry.gpu_max_run_ahead) || !reader.ReadOptionalT(&entry.gpu_pgxp_tolerance) ||
!reader.ReadOptionalT(&entry.gpu_pgxp_depth_threshold) || !reader.ReadOptionalT(&entry.gpu_line_detect_mode) ||
!reader.ReadOptionalT(&entry.gpu_pgxp_depth_threshold) ||
!reader.ReadOptionalT(&entry.gpu_pgxp_preserve_proj_fp) || !reader.ReadOptionalT(&entry.gpu_line_detect_mode) ||
!reader.ReadSizePrefixedString(&entry.disc_set_name) || !reader.ReadU32(&num_disc_set_serials))
{
DEV_LOG("Cache entry is corrupted.");
@ -1074,6 +1079,7 @@ bool GameDatabase::SaveToCache()
writer.WriteOptionalT(entry.gpu_max_run_ahead);
writer.WriteOptionalT(entry.gpu_pgxp_tolerance);
writer.WriteOptionalT(entry.gpu_pgxp_depth_threshold);
writer.WriteOptionalT(entry.gpu_pgxp_preserve_proj_fp);
writer.WriteOptionalT(entry.gpu_line_detect_mode);
writer.WriteSizePrefixedString(entry.disc_set_name);
@ -1335,6 +1341,7 @@ bool GameDatabase::ParseYamlEntry(Entry* entry, const ryml::ConstNodeRef& value)
entry->gpu_max_run_ahead = GetOptionalTFromObject<u32>(settings, "gpuMaxRunAhead");
entry->gpu_pgxp_tolerance = GetOptionalTFromObject<float>(settings, "gpuPGXPTolerance");
entry->gpu_pgxp_depth_threshold = GetOptionalTFromObject<float>(settings, "gpuPGXPDepthThreshold");
entry->gpu_pgxp_preserve_proj_fp = GetOptionalTFromObject<bool>(settings, "gpuPGXPPreserveProjFP");
entry->gpu_line_detect_mode =
ParseOptionalTFromObject<GPULineDetectMode>(settings, "gpuLineDetectMode", &Settings::ParseLineDetectModeName);
}

@ -53,7 +53,6 @@ enum class Trait : u32
DisablePGXPTextureCorrection,
DisablePGXPColorCorrection,
DisablePGXPDepthBuffer,
DisablePGXPPreserveProjFP,
DisablePGXPOn2DPolygons,
ForcePGXPVertexCache,
ForcePGXPCPUMode,
@ -125,6 +124,7 @@ struct Entry
std::optional<u32> gpu_max_run_ahead;
std::optional<float> gpu_pgxp_tolerance;
std::optional<float> gpu_pgxp_depth_threshold;
std::optional<bool> gpu_pgxp_preserve_proj_fp;
std::string disc_set_name;
std::vector<std::string> disc_set_serials;

@ -184,7 +184,8 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::SetAvailability(m_ui.pgxpCulling,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPCulling));
SettingWidgetBinder::SetAvailability(m_ui.pgxpPreserveProjPrecision,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPPreserveProjFP));
!m_dialog->hasDatabaseEntry() ||
m_dialog->getDatabaseEntry()->gpu_pgxp_preserve_proj_fp.value_or(true));
// OSD Tab
@ -1024,8 +1025,9 @@ void GraphicsSettingsWidget::updatePGXPSettingsEnabled()
m_ui.pgxpColorCorrection->setEnabled(tc_enabled &&
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPColorCorrection));
m_ui.pgxpDepthBuffer->setEnabled(enabled && !m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPDepthBuffer));
m_ui.pgxpPreserveProjPrecision->setEnabled(enabled &&
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPPreserveProjFP));
m_ui.pgxpPreserveProjPrecision->setEnabled(
enabled &&
(!m_dialog->hasDatabaseEntry() || m_dialog->getDatabaseEntry()->gpu_pgxp_preserve_proj_fp.value_or(true)));
m_ui.pgxpCPU->setEnabled(enabled);
m_ui.pgxpVertexCache->setEnabled(enabled);
m_ui.pgxpGeometryTolerance->setEnabled(enabled);

@ -63,6 +63,8 @@ public:
ALWAYS_INLINE const std::string& getGameTitle() const { return m_title; }
ALWAYS_INLINE const std::string& getGameSerial() const { return m_serial; }
ALWAYS_INLINE const std::optional<GameHash>& getGameHash() const { return m_hash; }
ALWAYS_INLINE const GameDatabase::Entry* getDatabaseEntry() const { return m_database_entry; }
ALWAYS_INLINE bool hasDatabaseEntry() const { return (m_database_entry != nullptr); }
ALWAYS_INLINE InterfaceSettingsWidget* getInterfaceSettingsWidget() const { return m_interface_settings; }
ALWAYS_INLINE BIOSSettingsWidget* getBIOSSettingsWidget() const { return m_bios_settings; }

Loading…
Cancel
Save