GameDatabase: Merge compatibility messages

This commit is contained in:
Stenzek 2024-07-22 13:55:02 +10:00
parent fe55446c25
commit deed0c9713
No known key found for this signature in database
10 changed files with 74 additions and 142 deletions

View file

@ -376,8 +376,6 @@ const char* GameDatabase::GetCompatibilityRatingDisplayName(CompatibilityRating
void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_messages) const void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_messages) const
{ {
constexpr float osd_duration = Host::OSD_INFO_DURATION;
if (display_active_start_offset.has_value()) if (display_active_start_offset.has_value())
{ {
settings.display_active_start_offset = display_active_start_offset.value(); settings.display_active_start_offset = display_active_start_offset.value();
@ -457,14 +455,18 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
} }
} }
SmallStackString<512> messages;
#define APPEND_MESSAGE(icon, msg) \
do \
{ \
messages.append("\n \u2022 "); \
messages.append(msg); \
} while (0)
if (HasTrait(Trait::ForceInterpreter)) if (HasTrait(Trait::ForceInterpreter))
{ {
if (display_osd_messages && settings.cpu_execution_mode != CPUExecutionMode::Interpreter) if (display_osd_messages && settings.cpu_execution_mode != CPUExecutionMode::Interpreter)
{ APPEND_MESSAGE(ICON_FA_MICROCHIP, TRANSLATE_SV("GameDatabase", "CPU recompiler disabled."));
Host::AddIconOSDMessage("gamedb_force_interpreter", ICON_FA_MICROCHIP,
TRANSLATE_STR("OSDMessage", "CPU interpreter forced by compatibility settings."),
osd_duration);
}
settings.cpu_execution_mode = CPUExecutionMode::Interpreter; settings.cpu_execution_mode = CPUExecutionMode::Interpreter;
} }
@ -472,11 +474,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::ForceSoftwareRenderer)) if (HasTrait(Trait::ForceSoftwareRenderer))
{ {
if (display_osd_messages && settings.gpu_renderer != GPURenderer::Software) if (display_osd_messages && settings.gpu_renderer != GPURenderer::Software)
{ APPEND_MESSAGE(ICON_FA_PAINT_ROLLER, TRANSLATE_SV("GameDatabase", "Hardware rendering disabled."));
Host::AddIconOSDMessage("gamedb_force_software", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "Software renderer forced by compatibility settings."),
osd_duration);
}
settings.gpu_renderer = GPURenderer::Software; settings.gpu_renderer = GPURenderer::Software;
} }
@ -484,12 +482,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::ForceSoftwareRendererForReadbacks)) if (HasTrait(Trait::ForceSoftwareRendererForReadbacks))
{ {
if (display_osd_messages && settings.gpu_renderer != GPURenderer::Software) if (display_osd_messages && settings.gpu_renderer != GPURenderer::Software)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "Software renderer readbacks enabled."));
Host::AddIconOSDMessage(
"gamedb_force_software_rb", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "Using software renderer for readbacks based on compatibility settings."),
osd_duration);
}
settings.gpu_use_software_renderer_for_readbacks = true; settings.gpu_use_software_renderer_for_readbacks = true;
} }
@ -502,11 +495,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::ForceInterlacing)) if (HasTrait(Trait::ForceInterlacing))
{ {
if (display_osd_messages && settings.gpu_disable_interlacing) if (display_osd_messages && settings.gpu_disable_interlacing)
{ APPEND_MESSAGE(ICON_FA_TV, TRANSLATE_SV("GameDatabase", "Interlaced rendering enabled."));
Host::AddIconOSDMessage("gamedb_force_interlacing", ICON_FA_TV,
TRANSLATE_STR("OSDMessage", "Interlacing forced by compatibility settings."),
osd_duration);
}
settings.gpu_disable_interlacing = false; settings.gpu_disable_interlacing = false;
} }
@ -514,11 +503,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisableTrueColor)) if (HasTrait(Trait::DisableTrueColor))
{ {
if (display_osd_messages && settings.gpu_true_color) if (display_osd_messages && settings.gpu_true_color)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "True color disabled."));
Host::AddIconOSDMessage("gamedb_disable_true_color", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "True color disabled by compatibility settings."),
osd_duration);
}
settings.gpu_true_color = false; settings.gpu_true_color = false;
} }
@ -526,11 +511,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisableUpscaling)) if (HasTrait(Trait::DisableUpscaling))
{ {
if (display_osd_messages && settings.gpu_resolution_scale > 1) if (display_osd_messages && settings.gpu_resolution_scale > 1)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "Upscaling disabled."));
Host::AddIconOSDMessage("gamedb_disable_upscaling", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "Upscaling disabled by compatibility settings."),
osd_duration);
}
settings.gpu_resolution_scale = 1; settings.gpu_resolution_scale = 1;
} }
@ -540,9 +521,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (display_osd_messages && (settings.gpu_texture_filter != GPUTextureFilter::Nearest || if (display_osd_messages && (settings.gpu_texture_filter != GPUTextureFilter::Nearest ||
g_settings.gpu_sprite_texture_filter != GPUTextureFilter::Nearest)) g_settings.gpu_sprite_texture_filter != GPUTextureFilter::Nearest))
{ {
Host::AddIconOSDMessage("gamedb_disable_upscaling", ICON_FA_MAGIC, APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "Texture filtering disabled."));
TRANSLATE_STR("OSDMessage", "Texture filtering disabled by compatibility settings."),
osd_duration);
} }
settings.gpu_texture_filter = GPUTextureFilter::Nearest; settings.gpu_texture_filter = GPUTextureFilter::Nearest;
@ -552,11 +531,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisableScaledDithering)) if (HasTrait(Trait::DisableScaledDithering))
{ {
if (display_osd_messages && settings.gpu_scaled_dithering) if (display_osd_messages && settings.gpu_scaled_dithering)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "Scaled dithering."));
Host::AddIconOSDMessage("gamedb_disable_scaled_dithering", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "Scaled dithering disabled by compatibility settings."),
osd_duration);
}
settings.gpu_scaled_dithering = false; settings.gpu_scaled_dithering = false;
} }
@ -564,11 +539,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisableWidescreen)) if (HasTrait(Trait::DisableWidescreen))
{ {
if (display_osd_messages && settings.gpu_widescreen_hack) if (display_osd_messages && settings.gpu_widescreen_hack)
{ APPEND_MESSAGE(ICON_FA_TV, TRANSLATE_SV("GameDatabase", "Widescreen rendering disabled."));
Host::AddIconOSDMessage("gamedb_disable_widescreen", ICON_FA_TV,
TRANSLATE_STR("OSDMessage", "Widescreen rendering disabled by compatibility settings."),
osd_duration);
}
settings.gpu_widescreen_hack = false; settings.gpu_widescreen_hack = false;
} }
@ -576,11 +547,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisableForceNTSCTimings)) if (HasTrait(Trait::DisableForceNTSCTimings))
{ {
if (display_osd_messages && settings.gpu_force_ntsc_timings) if (display_osd_messages && settings.gpu_force_ntsc_timings)
{ APPEND_MESSAGE(ICON_FA_TV, TRANSLATE_SV("GameDatabase", "Force NTSC timings disabled."));
Host::AddIconOSDMessage("gamedb_disable_force_ntsc_timings", ICON_FA_TV,
TRANSLATE_STR("OSDMessage", "Forcing NTSC Timings disallowed by compatibility settings."),
osd_duration);
}
settings.gpu_force_ntsc_timings = false; settings.gpu_force_ntsc_timings = false;
} }
@ -588,11 +555,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisablePGXP)) if (HasTrait(Trait::DisablePGXP))
{ {
if (display_osd_messages && settings.gpu_pgxp_enable) if (display_osd_messages && settings.gpu_pgxp_enable)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "PGXP geometry correction disabled."));
Host::AddIconOSDMessage(
"gamedb_disable_pgxp", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "PGXP geometry correction disabled by compatibility settings."), osd_duration);
}
settings.gpu_pgxp_enable = false; settings.gpu_pgxp_enable = false;
} }
@ -600,11 +563,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisablePGXPCulling)) if (HasTrait(Trait::DisablePGXPCulling))
{ {
if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_culling) if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_culling)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "PGXP culling correction disabled."));
Host::AddIconOSDMessage("gamedb_disable_pgxp_culling", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "PGXP culling disabled by compatibility settings."),
osd_duration);
}
settings.gpu_pgxp_culling = false; settings.gpu_pgxp_culling = false;
} }
@ -612,12 +571,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisablePGXPTextureCorrection)) if (HasTrait(Trait::DisablePGXPTextureCorrection))
{ {
if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_texture_correction) if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_texture_correction)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "PGXP perspective correct textures disabled."));
Host::AddIconOSDMessage(
"gamedb_disable_pgxp_texture", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "PGXP perspective corrected textures disabled by compatibility settings."),
osd_duration);
}
settings.gpu_pgxp_texture_correction = false; settings.gpu_pgxp_texture_correction = false;
} }
@ -627,10 +581,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_texture_correction && if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_texture_correction &&
settings.gpu_pgxp_color_correction) settings.gpu_pgxp_color_correction)
{ {
Host::AddIconOSDMessage( APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "PGXP perspective correct colors disabled."));
"gamedb_disable_pgxp_texture", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "PGXP perspective corrected colors disabled by compatibility settings."),
osd_duration);
} }
settings.gpu_pgxp_color_correction = false; settings.gpu_pgxp_color_correction = false;
@ -639,12 +590,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisablePGXPPreserveProjFP)) if (HasTrait(Trait::DisablePGXPPreserveProjFP))
{ {
if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_preserve_proj_fp) if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_preserve_proj_fp)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "PGXP preserve projection precision disabled."));
Host::AddIconOSDMessage(
"gamedb_disable_pgxp_texture", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "PGXP projection precision preservation disabled by compatibility settings."),
osd_duration);
}
settings.gpu_pgxp_preserve_proj_fp = false; settings.gpu_pgxp_preserve_proj_fp = false;
} }
@ -652,22 +598,18 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::ForcePGXPVertexCache)) if (HasTrait(Trait::ForcePGXPVertexCache))
{ {
if (display_osd_messages && settings.gpu_pgxp_enable && !settings.gpu_pgxp_vertex_cache) if (display_osd_messages && settings.gpu_pgxp_enable && !settings.gpu_pgxp_vertex_cache)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "PGXP vertex cache enabled."));
Host::AddIconOSDMessage("gamedb_force_pgxp_vertex_cache", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "PGXP vertex cache forced by compatibility settings."),
osd_duration);
}
settings.gpu_pgxp_vertex_cache = settings.gpu_pgxp_enable; settings.gpu_pgxp_vertex_cache = settings.gpu_pgxp_enable;
} }
else if (settings.gpu_pgxp_enable && settings.gpu_pgxp_vertex_cache) else if (settings.gpu_pgxp_enable && settings.gpu_pgxp_vertex_cache)
{ {
Host::AddIconOSDMessage( Host::AddIconOSDMessage(
"gamedb_force_pgxp_vertex_cache", ICON_FA_MICROCHIP, "gamedb_force_pgxp_vertex_cache", ICON_FA_EXCLAMATION_TRIANGLE,
TRANSLATE_STR( TRANSLATE_STR(
"OSDMessage", "GameDatabase",
"PGXP Vertex Cache is enabled, but it is not required for this game. This may cause rendering errors."), "PGXP Vertex Cache is enabled, but it is not required for this game. This may cause rendering errors."),
osd_duration); Host::OSD_WARNING_DURATION);
} }
if (HasTrait(Trait::ForcePGXPCPUMode)) if (HasTrait(Trait::ForcePGXPCPUMode))
@ -675,9 +617,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (display_osd_messages && settings.gpu_pgxp_enable && !settings.gpu_pgxp_cpu) if (display_osd_messages && settings.gpu_pgxp_enable && !settings.gpu_pgxp_cpu)
{ {
#ifndef __ANDROID__ #ifndef __ANDROID__
Host::AddIconOSDMessage("gamedb_force_pgxp_cpu", ICON_FA_MICROCHIP, APPEND_MESSAGE(ICON_FA_MICROCHIP, TRANSLATE_SV("GameDatabase", "PGXP CPU mode enabled."));
TRANSLATE_STR("OSDMessage", "PGXP CPU mode forced by compatibility settings."),
osd_duration);
#else #else
Host::AddIconOSDMessage( Host::AddIconOSDMessage(
"gamedb_force_pgxp_cpu", ICON_FA_MICROCHIP, "gamedb_force_pgxp_cpu", ICON_FA_MICROCHIP,
@ -693,19 +633,15 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
{ {
Host::AddIconOSDMessage( Host::AddIconOSDMessage(
"gamedb_force_pgxp_cpu", ICON_FA_MICROCHIP, "gamedb_force_pgxp_cpu", ICON_FA_MICROCHIP,
TRANSLATE_STR("OSDMessage", TRANSLATE_STR("GameDatabase",
"PGXP CPU mode is enabled, but it is not required for this game. This may cause rendering errors."), "PGXP CPU mode is enabled, but it is not required for this game. This may cause rendering errors."),
osd_duration); Host::OSD_WARNING_DURATION);
} }
if (HasTrait(Trait::DisablePGXPDepthBuffer)) if (HasTrait(Trait::DisablePGXPDepthBuffer))
{ {
if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_depth_buffer) if (display_osd_messages && settings.gpu_pgxp_enable && settings.gpu_pgxp_depth_buffer)
{ APPEND_MESSAGE(ICON_FA_MAGIC, TRANSLATE_SV("GameDatabase", "PGXP depth buffer disabled."));
Host::AddIconOSDMessage("gamedb_disable_pgxp_depth", ICON_FA_MAGIC,
TRANSLATE_STR("OSDMessage", "PGXP Depth Buffer disabled by compatibility settings."),
osd_duration);
}
settings.gpu_pgxp_depth_buffer = false; settings.gpu_pgxp_depth_buffer = false;
} }
@ -713,11 +649,8 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
if (HasTrait(Trait::DisablePGXPOn2DPolygons)) if (HasTrait(Trait::DisablePGXPOn2DPolygons))
{ {
if (display_osd_messages && settings.gpu_pgxp_enable && !settings.gpu_pgxp_disable_2d) if (display_osd_messages && settings.gpu_pgxp_enable && !settings.gpu_pgxp_disable_2d)
{ APPEND_MESSAGE(ICON_FA_MICROCHIP, TRANSLATE_SV("GameDatabase", "PGXP disabled on 2D polygons."));
Host::AddIconOSDMessage("gamedb_disable_pgxp_2d", ICON_FA_MICROCHIP,
TRANSLATE_STR("OSDMessage", "PGXP disabled on 2D polygons by compatibility settings."),
osd_duration);
}
g_settings.gpu_pgxp_disable_2d = true; g_settings.gpu_pgxp_disable_2d = true;
} }
@ -739,6 +672,17 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
settings.cpu_fastmem_mode = CPUFastmemMode::LUT; settings.cpu_fastmem_mode = CPUFastmemMode::LUT;
} }
if (!messages.empty())
{
Host::AddIconOSDMessage(
"GameDBCompatibility", ICON_FA_MICROCHIP,
fmt::format("{}{}", TRANSLATE_SV("GameDatabase", "Compatibility settings for this game have been applied:"),
messages.view()),
Host::OSD_WARNING_DURATION);
}
#undef APPEND_MESSAGE
#define BIT_FOR(ctype) (static_cast<u16>(1) << static_cast<u32>(ctype)) #define BIT_FOR(ctype) (static_cast<u16>(1) << static_cast<u32>(ctype))
if (supported_controllers != 0 && supported_controllers != static_cast<u16>(-1)) if (supported_controllers != 0 && supported_controllers != static_cast<u16>(-1))
@ -777,7 +721,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes
Host::AddKeyedOSDMessage( Host::AddKeyedOSDMessage(
"gamedb_controller_unsupported", "gamedb_controller_unsupported",
fmt::format(TRANSLATE_FS("OSDMessage", fmt::format(TRANSLATE_FS("GameDatabase",
"Controller in port {0} ({1}) is not supported for {2}.\nSupported controllers: " "Controller in port {0} ({1}) is not supported for {2}.\nSupported controllers: "
"{3}\nPlease configure a supported controller from the list above."), "{3}\nPlease configure a supported controller from the list above."),
i + 1u, Controller::GetControllerInfo(ctype)->GetDisplayName(), System::GetGameTitle(), i + 1u, Controller::GetControllerInfo(ctype)->GetDisplayName(), System::GetGameTitle(),

View file

@ -94,7 +94,7 @@ bool GPU::Initialize()
m_console_is_pal = System::IsPALRegion(); m_console_is_pal = System::IsPALRegion();
UpdateCRTCConfig(); UpdateCRTCConfig();
if (!CompileDisplayPipelines(true, true, g_settings.gpu_24bit_chroma_smoothing)) if (!CompileDisplayPipelines(true, true, g_settings.display_24bit_chroma_smoothing))
{ {
Host::ReportErrorAsync("Error", "Failed to compile base GPU pipelines."); Host::ReportErrorAsync("Error", "Failed to compile base GPU pipelines.");
return false; return false;
@ -130,7 +130,7 @@ void GPU::UpdateSettings(const Settings& old_settings)
if (g_settings.display_scaling != old_settings.display_scaling || if (g_settings.display_scaling != old_settings.display_scaling ||
g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode || g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode ||
g_settings.gpu_24bit_chroma_smoothing != old_settings.gpu_24bit_chroma_smoothing) g_settings.display_24bit_chroma_smoothing != old_settings.display_24bit_chroma_smoothing)
{ {
// Toss buffers on mode change. // Toss buffers on mode change.
if (g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode) if (g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode)
@ -138,7 +138,7 @@ void GPU::UpdateSettings(const Settings& old_settings)
if (!CompileDisplayPipelines(g_settings.display_scaling != old_settings.display_scaling, if (!CompileDisplayPipelines(g_settings.display_scaling != old_settings.display_scaling,
g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode, g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode,
g_settings.gpu_24bit_chroma_smoothing != old_settings.gpu_24bit_chroma_smoothing)) g_settings.display_24bit_chroma_smoothing != old_settings.display_24bit_chroma_smoothing))
{ {
Panic("Failed to compile display pipeline on settings change."); Panic("Failed to compile display pipeline on settings change.");
} }
@ -1886,7 +1886,7 @@ bool GPU::CompileDisplayPipelines(bool display, bool deinterlace, bool chroma_sm
m_chroma_smoothing_pipeline.reset(); m_chroma_smoothing_pipeline.reset();
g_gpu_device->RecycleTexture(std::move(m_chroma_smoothing_texture)); g_gpu_device->RecycleTexture(std::move(m_chroma_smoothing_texture));
if (g_settings.gpu_24bit_chroma_smoothing) if (g_settings.display_24bit_chroma_smoothing)
{ {
plconfig.layout = GPUPipeline::Layout::SingleTextureAndPushConstants; plconfig.layout = GPUPipeline::Layout::SingleTextureAndPushConstants;
plconfig.SetTargetFormats(GPUTexture::Format::RGBA8); plconfig.SetTargetFormats(GPUTexture::Format::RGBA8);

View file

@ -3527,7 +3527,7 @@ void GPU_HW::UpdateDisplay()
SetDisplayTexture(m_vram_extract_texture.get(), depth_source ? m_vram_extract_depth_texture.get() : nullptr, 0, 0, SetDisplayTexture(m_vram_extract_texture.get(), depth_source ? m_vram_extract_depth_texture.get() : nullptr, 0, 0,
scaled_display_width, read_height); scaled_display_width, read_height);
if (g_settings.gpu_24bit_chroma_smoothing) if (g_settings.display_24bit_chroma_smoothing)
{ {
if (ApplyChromaSmoothing()) if (ApplyChromaSmoothing())
{ {

View file

@ -449,7 +449,7 @@ void GPU_SW::UpdateDisplay()
if (CopyOut(vram_offset_x, vram_offset_y, skip_x, read_width, read_height, line_skip, is_24bit)) if (CopyOut(vram_offset_x, vram_offset_y, skip_x, read_width, read_height, line_skip, is_24bit))
{ {
SetDisplayTexture(m_upload_texture.get(), nullptr, 0, 0, read_width, read_height); SetDisplayTexture(m_upload_texture.get(), nullptr, 0, 0, read_width, read_height);
if (is_24bit && g_settings.gpu_24bit_chroma_smoothing) if (is_24bit && g_settings.display_24bit_chroma_smoothing)
{ {
if (ApplyChromaSmoothing()) if (ApplyChromaSmoothing())
Deinterlace(field, 0); Deinterlace(field, 0);
@ -465,7 +465,7 @@ void GPU_SW::UpdateDisplay()
if (CopyOut(vram_offset_x, vram_offset_y, skip_x, read_width, read_height, 0, is_24bit)) if (CopyOut(vram_offset_x, vram_offset_y, skip_x, read_width, read_height, 0, is_24bit))
{ {
SetDisplayTexture(m_upload_texture.get(), nullptr, 0, 0, read_width, read_height); SetDisplayTexture(m_upload_texture.get(), nullptr, 0, 0, read_width, read_height);
if (is_24bit && g_settings.gpu_24bit_chroma_smoothing) if (is_24bit && g_settings.display_24bit_chroma_smoothing)
ApplyChromaSmoothing(); ApplyChromaSmoothing();
} }
} }

View file

@ -190,6 +190,7 @@ void Settings::Load(SettingsInterface& si)
gpu_disable_framebuffer_fetch = si.GetBoolValue("GPU", "DisableFramebufferFetch", false); gpu_disable_framebuffer_fetch = si.GetBoolValue("GPU", "DisableFramebufferFetch", false);
gpu_disable_texture_buffers = si.GetBoolValue("GPU", "DisableTextureBuffers", false); gpu_disable_texture_buffers = si.GetBoolValue("GPU", "DisableTextureBuffers", false);
gpu_disable_texture_copy_to_self = si.GetBoolValue("GPU", "DisableTextureCopyToSelf", false); gpu_disable_texture_copy_to_self = si.GetBoolValue("GPU", "DisableTextureCopyToSelf", false);
gpu_disable_memory_import = si.GetBoolValue("GPU", "DisableMemoryImport", false);
gpu_per_sample_shading = si.GetBoolValue("GPU", "PerSampleShading", false); gpu_per_sample_shading = si.GetBoolValue("GPU", "PerSampleShading", false);
gpu_use_thread = si.GetBoolValue("GPU", "UseThread", true); gpu_use_thread = si.GetBoolValue("GPU", "UseThread", true);
gpu_use_software_renderer_for_readbacks = si.GetBoolValue("GPU", "UseSoftwareRendererForReadbacks", false); gpu_use_software_renderer_for_readbacks = si.GetBoolValue("GPU", "UseSoftwareRendererForReadbacks", false);
@ -222,7 +223,7 @@ void Settings::Load(SettingsInterface& si)
gpu_disable_interlacing = si.GetBoolValue("GPU", "DisableInterlacing", true); gpu_disable_interlacing = si.GetBoolValue("GPU", "DisableInterlacing", true);
gpu_force_ntsc_timings = si.GetBoolValue("GPU", "ForceNTSCTimings", false); gpu_force_ntsc_timings = si.GetBoolValue("GPU", "ForceNTSCTimings", false);
gpu_widescreen_hack = si.GetBoolValue("GPU", "WidescreenHack", false); gpu_widescreen_hack = si.GetBoolValue("GPU", "WidescreenHack", false);
gpu_24bit_chroma_smoothing = si.GetBoolValue("GPU", "ChromaSmoothing24Bit", false); display_24bit_chroma_smoothing = si.GetBoolValue("GPU", "ChromaSmoothing24Bit", false);
gpu_pgxp_enable = si.GetBoolValue("GPU", "PGXPEnable", false); gpu_pgxp_enable = si.GetBoolValue("GPU", "PGXPEnable", false);
gpu_pgxp_culling = si.GetBoolValue("GPU", "PGXPCulling", true); gpu_pgxp_culling = si.GetBoolValue("GPU", "PGXPCulling", true);
gpu_pgxp_texture_correction = si.GetBoolValue("GPU", "PGXPTextureCorrection", true); gpu_pgxp_texture_correction = si.GetBoolValue("GPU", "PGXPTextureCorrection", true);
@ -492,6 +493,7 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
si.SetBoolValue("GPU", "DisableFramebufferFetch", gpu_disable_framebuffer_fetch); si.SetBoolValue("GPU", "DisableFramebufferFetch", gpu_disable_framebuffer_fetch);
si.SetBoolValue("GPU", "DisableTextureBuffers", gpu_disable_texture_buffers); si.SetBoolValue("GPU", "DisableTextureBuffers", gpu_disable_texture_buffers);
si.SetBoolValue("GPU", "DisableTextureCopyToSelf", gpu_disable_texture_copy_to_self); si.SetBoolValue("GPU", "DisableTextureCopyToSelf", gpu_disable_texture_copy_to_self);
si.SetBoolValue("GPU", "DisableMemoryImport", gpu_disable_memory_import);
} }
si.SetBoolValue("GPU", "PerSampleShading", gpu_per_sample_shading); si.SetBoolValue("GPU", "PerSampleShading", gpu_per_sample_shading);
@ -513,7 +515,7 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
si.SetBoolValue("GPU", "DisableInterlacing", gpu_disable_interlacing); si.SetBoolValue("GPU", "DisableInterlacing", gpu_disable_interlacing);
si.SetBoolValue("GPU", "ForceNTSCTimings", gpu_force_ntsc_timings); si.SetBoolValue("GPU", "ForceNTSCTimings", gpu_force_ntsc_timings);
si.SetBoolValue("GPU", "WidescreenHack", gpu_widescreen_hack); si.SetBoolValue("GPU", "WidescreenHack", gpu_widescreen_hack);
si.SetBoolValue("GPU", "ChromaSmoothing24Bit", gpu_24bit_chroma_smoothing); si.SetBoolValue("GPU", "ChromaSmoothing24Bit", display_24bit_chroma_smoothing);
si.SetBoolValue("GPU", "PGXPEnable", gpu_pgxp_enable); si.SetBoolValue("GPU", "PGXPEnable", gpu_pgxp_enable);
si.SetBoolValue("GPU", "PGXPCulling", gpu_pgxp_culling); si.SetBoolValue("GPU", "PGXPCulling", gpu_pgxp_culling);
si.SetBoolValue("GPU", "PGXPTextureCorrection", gpu_pgxp_texture_correction); si.SetBoolValue("GPU", "PGXPTextureCorrection", gpu_pgxp_texture_correction);
@ -721,7 +723,7 @@ void Settings::FixIncompatibleSettings(bool display_osd_messages)
g_settings.gpu_force_ntsc_timings = false; g_settings.gpu_force_ntsc_timings = false;
g_settings.gpu_widescreen_hack = false; g_settings.gpu_widescreen_hack = false;
g_settings.gpu_pgxp_enable = false; g_settings.gpu_pgxp_enable = false;
g_settings.gpu_24bit_chroma_smoothing = false; g_settings.display_24bit_chroma_smoothing = false;
g_settings.cdrom_read_speedup = 1; g_settings.cdrom_read_speedup = 1;
g_settings.cdrom_seek_speedup = 1; g_settings.cdrom_seek_speedup = 1;
g_settings.cdrom_mute_cd_audio = false; g_settings.cdrom_mute_cd_audio = false;

View file

@ -113,17 +113,12 @@ struct Settings
bool gpu_disable_framebuffer_fetch : 1 = false; bool gpu_disable_framebuffer_fetch : 1 = false;
bool gpu_disable_texture_buffers : 1 = false; bool gpu_disable_texture_buffers : 1 = false;
bool gpu_disable_texture_copy_to_self : 1 = false; bool gpu_disable_texture_copy_to_self : 1 = false;
bool gpu_disable_memory_import : 1 = false;
bool gpu_per_sample_shading : 1 = false; bool gpu_per_sample_shading : 1 = false;
bool gpu_true_color : 1 = true; bool gpu_true_color : 1 = true;
bool gpu_debanding : 1 = false; bool gpu_debanding : 1 = false;
bool gpu_scaled_dithering : 1 = true; bool gpu_scaled_dithering : 1 = true;
bool gpu_force_round_texcoords : 1 = false; bool gpu_force_round_texcoords : 1 = false;
GPUTextureFilter gpu_texture_filter = DEFAULT_GPU_TEXTURE_FILTER;
GPUTextureFilter gpu_sprite_texture_filter = DEFAULT_GPU_TEXTURE_FILTER;
GPULineDetectMode gpu_line_detect_mode = DEFAULT_GPU_LINE_DETECT_MODE;
GPUDownsampleMode gpu_downsample_mode = DEFAULT_GPU_DOWNSAMPLE_MODE;
u8 gpu_downsample_scale = 1;
GPUWireframeMode gpu_wireframe_mode = DEFAULT_GPU_WIREFRAME_MODE;
bool gpu_disable_interlacing : 1 = true; bool gpu_disable_interlacing : 1 = true;
bool gpu_force_ntsc_timings : 1 = false; bool gpu_force_ntsc_timings : 1 = false;
bool gpu_widescreen_hack : 1 = false; bool gpu_widescreen_hack : 1 = false;
@ -136,6 +131,12 @@ struct Settings
bool gpu_pgxp_preserve_proj_fp : 1 = false; bool gpu_pgxp_preserve_proj_fp : 1 = false;
bool gpu_pgxp_depth_buffer : 1 = false; bool gpu_pgxp_depth_buffer : 1 = false;
bool gpu_pgxp_disable_2d : 1 = false; bool gpu_pgxp_disable_2d : 1 = false;
GPUTextureFilter gpu_texture_filter = DEFAULT_GPU_TEXTURE_FILTER;
GPUTextureFilter gpu_sprite_texture_filter = DEFAULT_GPU_TEXTURE_FILTER;
GPULineDetectMode gpu_line_detect_mode = DEFAULT_GPU_LINE_DETECT_MODE;
GPUDownsampleMode gpu_downsample_mode = DEFAULT_GPU_DOWNSAMPLE_MODE;
u8 gpu_downsample_scale = 1;
GPUWireframeMode gpu_wireframe_mode = DEFAULT_GPU_WIREFRAME_MODE;
DisplayDeinterlacingMode display_deinterlacing_mode = DEFAULT_DISPLAY_DEINTERLACING_MODE; DisplayDeinterlacingMode display_deinterlacing_mode = DEFAULT_DISPLAY_DEINTERLACING_MODE;
DisplayCropMode display_crop_mode = DEFAULT_DISPLAY_CROP_MODE; DisplayCropMode display_crop_mode = DEFAULT_DISPLAY_CROP_MODE;
DisplayAspectRatio display_aspect_ratio = DEFAULT_DISPLAY_ASPECT_RATIO; DisplayAspectRatio display_aspect_ratio = DEFAULT_DISPLAY_ASPECT_RATIO;
@ -157,7 +158,7 @@ struct Settings
bool display_vsync : 1 = false; bool display_vsync : 1 = false;
bool display_disable_mailbox_presentation : 1 = true; bool display_disable_mailbox_presentation : 1 = true;
bool display_force_4_3_for_24bit : 1 = false; bool display_force_4_3_for_24bit : 1 = false;
bool gpu_24bit_chroma_smoothing : 1 = false; bool display_24bit_chroma_smoothing : 1 = false;
bool display_show_osd_messages : 1 = true; bool display_show_osd_messages : 1 = true;
bool display_show_fps : 1 = false; bool display_show_fps : 1 = false;
bool display_show_speed : 1 = false; bool display_show_speed : 1 = false;

View file

@ -3937,6 +3937,7 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.gpu_disable_framebuffer_fetch != old_settings.gpu_disable_framebuffer_fetch || g_settings.gpu_disable_framebuffer_fetch != old_settings.gpu_disable_framebuffer_fetch ||
g_settings.gpu_disable_texture_buffers != old_settings.gpu_disable_texture_buffers || g_settings.gpu_disable_texture_buffers != old_settings.gpu_disable_texture_buffers ||
g_settings.gpu_disable_texture_copy_to_self != old_settings.gpu_disable_texture_copy_to_self || g_settings.gpu_disable_texture_copy_to_self != old_settings.gpu_disable_texture_copy_to_self ||
g_settings.gpu_disable_memory_import != old_settings.gpu_disable_memory_import ||
g_settings.display_exclusive_fullscreen_control != old_settings.display_exclusive_fullscreen_control)) g_settings.display_exclusive_fullscreen_control != old_settings.display_exclusive_fullscreen_control))
{ {
// if debug device/threaded presentation change, we need to recreate the whole display // if debug device/threaded presentation change, we need to recreate the whole display
@ -3948,6 +3949,7 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.gpu_disable_framebuffer_fetch != old_settings.gpu_disable_framebuffer_fetch || g_settings.gpu_disable_framebuffer_fetch != old_settings.gpu_disable_framebuffer_fetch ||
g_settings.gpu_disable_texture_buffers != old_settings.gpu_disable_texture_buffers || g_settings.gpu_disable_texture_buffers != old_settings.gpu_disable_texture_buffers ||
g_settings.gpu_disable_texture_copy_to_self != old_settings.gpu_disable_texture_copy_to_self || g_settings.gpu_disable_texture_copy_to_self != old_settings.gpu_disable_texture_copy_to_self ||
g_settings.gpu_disable_memory_import != old_settings.gpu_disable_memory_import ||
g_settings.display_exclusive_fullscreen_control != old_settings.display_exclusive_fullscreen_control); g_settings.display_exclusive_fullscreen_control != old_settings.display_exclusive_fullscreen_control);
Host::AddIconOSDMessage("RendererSwitch", ICON_FA_PAINT_ROLLER, Host::AddIconOSDMessage("RendererSwitch", ICON_FA_PAINT_ROLLER,
@ -4058,11 +4060,11 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.gpu_line_detect_mode != old_settings.gpu_line_detect_mode || g_settings.gpu_line_detect_mode != old_settings.gpu_line_detect_mode ||
g_settings.gpu_disable_interlacing != old_settings.gpu_disable_interlacing || g_settings.gpu_disable_interlacing != old_settings.gpu_disable_interlacing ||
g_settings.gpu_force_ntsc_timings != old_settings.gpu_force_ntsc_timings || g_settings.gpu_force_ntsc_timings != old_settings.gpu_force_ntsc_timings ||
g_settings.gpu_24bit_chroma_smoothing != old_settings.gpu_24bit_chroma_smoothing ||
g_settings.gpu_downsample_mode != old_settings.gpu_downsample_mode || g_settings.gpu_downsample_mode != old_settings.gpu_downsample_mode ||
g_settings.gpu_downsample_scale != old_settings.gpu_downsample_scale || g_settings.gpu_downsample_scale != old_settings.gpu_downsample_scale ||
g_settings.gpu_wireframe_mode != old_settings.gpu_wireframe_mode || g_settings.gpu_wireframe_mode != old_settings.gpu_wireframe_mode ||
g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode || g_settings.display_deinterlacing_mode != old_settings.display_deinterlacing_mode ||
g_settings.display_24bit_chroma_smoothing != old_settings.display_24bit_chroma_smoothing ||
g_settings.display_crop_mode != old_settings.display_crop_mode || g_settings.display_crop_mode != old_settings.display_crop_mode ||
g_settings.display_aspect_ratio != old_settings.display_aspect_ratio || g_settings.display_aspect_ratio != old_settings.display_aspect_ratio ||
g_settings.display_alignment != old_settings.display_alignment || g_settings.display_alignment != old_settings.display_alignment ||

View file

@ -220,6 +220,7 @@ const char* QtHost::GetDefaultLanguage()
static constexpr const ImWchar s_base_latin_range[] = { static constexpr const ImWchar s_base_latin_range[] = {
0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x2022, 0x2022, // General punctuation
}; };
static constexpr const ImWchar s_central_european_ranges[] = { static constexpr const ImWchar s_central_european_ranges[] = {
0x0100, 0x017F, // Central European diacritics 0x0100, 0x017F, // Central European diacritics

View file

@ -117,6 +117,9 @@ bool RegTestHost::InitializeConfig()
EmuFolders::LoadConfig(*s_base_settings_interface.get()); EmuFolders::LoadConfig(*s_base_settings_interface.get());
EmuFolders::EnsureFoldersExist(); EmuFolders::EnsureFoldersExist();
// imgui setup, make sure it doesn't bug out
ImGuiManager::SetFontPathAndRange(std::string(), {0x0020, 0x00FF});
return true; return true;
} }

View file

@ -523,31 +523,10 @@ bool ImGuiManager::LoadFontData()
ImFont* ImGuiManager::AddTextFont(float size) ImFont* ImGuiManager::AddTextFont(float size)
{ {
static const ImWchar default_ranges[] = {
// Basic Latin + Latin Supplement + Central European diacritics
0x0020,
0x017F,
// Cyrillic + Cyrillic Supplement
0x0400,
0x052F,
// Cyrillic Extended-A
0x2DE0,
0x2DFF,
// Cyrillic Extended-B
0xA640,
0xA69F,
0,
};
ImFontConfig cfg; ImFontConfig cfg;
cfg.FontDataOwnedByAtlas = false; cfg.FontDataOwnedByAtlas = false;
return ImGui::GetIO().Fonts->AddFontFromMemoryTTF(s_standard_font_data.data(), return ImGui::GetIO().Fonts->AddFontFromMemoryTTF(
static_cast<int>(s_standard_font_data.size()), size, &cfg, s_standard_font_data.data(), static_cast<int>(s_standard_font_data.size()), size, &cfg, s_font_range.data());
s_font_range.empty() ? default_ranges : s_font_range.data());
} }
ImFont* ImGuiManager::AddFixedFont(float size) ImFont* ImGuiManager::AddFixedFont(float size)