|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|