diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index 24559b4b2b..8a4985b722 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -354,7 +354,7 @@ void GLFragmentProgram::Decompile(const RSXFragmentProgram& prog) std::string source; GLFragmentDecompilerThread decompiler(source, parr, prog, size); - if (!g_cfg.video.disable_native_float16) + if (g_cfg.video.shader_precision == gpu_preset_level::low) { const auto driver_caps = gl::get_driver_caps(); decompiler.device_props.has_native_half_support = driver_caps.NV_gpu_shader5_supported || driver_caps.AMD_gpu_shader_half_float_supported; diff --git a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp index ee4f758747..98327b0852 100644 --- a/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp @@ -419,7 +419,7 @@ void VKFragmentProgram::Decompile(const RSXFragmentProgram& prog) VKFragmentDecompilerThread decompiler(source, parr, prog, size, *this); const auto pdev = vk::get_current_renderer(); - if (!g_cfg.video.disable_native_float16) + if (g_cfg.video.shader_precision == gpu_preset_level::low) { decompiler.device_props.has_native_half_support = pdev->get_shader_types_support().allow_float16; } diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index 897539c8a4..d754e37a84 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -132,6 +132,7 @@ struct cfg_root : cfg::node cfg::_enum frame_limit{ this, "Frame limit", frame_limit_type::_auto, true }; cfg::_enum antialiasing_level{ this, "MSAA", msaa_level::_auto }; cfg::_enum shadermode{ this, "Shader Mode", shader_mode::async_recompiler }; + cfg::_enum shader_precision{ this, "Shader Precision", gpu_preset_level::high }; cfg::_bool write_color_buffers{ this, "Write Color Buffers" }; cfg::_bool write_depth_buffer{ this, "Write Depth Buffer" }; @@ -156,11 +157,6 @@ struct cfg_root : cfg::node cfg::_bool disable_vulkan_mem_allocator{ this, "Disable Vulkan Memory Allocator", false }; cfg::_bool full_rgb_range_output{ this, "Use full RGB output range", true, true }; // Video out dynamic range cfg::_bool strict_texture_flushing{ this, "Strict Texture Flushing", false }; -#ifdef __APPLE__ - cfg::_bool disable_native_float16{ this, "Disable native float16 support", true }; -#else - cfg::_bool disable_native_float16{ this, "Disable native float16 support", false }; -#endif cfg::_bool multithreaded_rsx{ this, "Multithreaded RSX", false }; cfg::_bool relaxed_zcull_sync{ this, "Relaxed ZCULL Sync", false }; cfg::_bool enable_3d{ this, "Enable 3D", false }; diff --git a/rpcs3/Emu/system_config_types.cpp b/rpcs3/Emu/system_config_types.cpp index f87fc2a8e4..6f82c7cdcc 100644 --- a/rpcs3/Emu/system_config_types.cpp +++ b/rpcs3/Emu/system_config_types.cpp @@ -596,3 +596,18 @@ void fmt_class_string::format(std::string& out, u64 arg) return unknown; }); } + +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + format_enum(out, arg, [](gpu_preset_level value) + { + switch (value) + { + case gpu_preset_level::high: return "High"; + case gpu_preset_level::low: return "Low"; + } + + return unknown; + }); +} diff --git a/rpcs3/Emu/system_config_types.h b/rpcs3/Emu/system_config_types.h index 802edea253..b708fcec3c 100644 --- a/rpcs3/Emu/system_config_types.h +++ b/rpcs3/Emu/system_config_types.h @@ -288,3 +288,10 @@ enum class zcull_precision_level relaxed, undefined }; + +enum class gpu_preset_level +{ + high, + low, + _auto +}; diff --git a/rpcs3/rpcs3qt/emu_settings_type.h b/rpcs3/rpcs3qt/emu_settings_type.h index 6957030a7a..3b654b11be 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.h +++ b/rpcs3/rpcs3qt/emu_settings_type.h @@ -74,7 +74,7 @@ enum class emu_settings_type DisableVideoOutput, DisableFIFOReordering, StrictTextureFlushing, - DisableNativefloat16, + ShaderPrecisionQuality, Enable3D, AnisotropicFilterOverride, ResolutionScale, @@ -246,7 +246,6 @@ inline static const QMap settings_location = { emu_settings_type::DisableOcclusionQueries, { "Video", "Disable ZCull Occlusion Queries"}}, { emu_settings_type::DisableVideoOutput, { "Video", "Disable Video Output"}}, { emu_settings_type::DisableFIFOReordering, { "Video", "Disable FIFO Reordering"}}, - { emu_settings_type::DisableNativefloat16, { "Video", "Disable native float16 support"}}, { emu_settings_type::Enable3D, { "Video", "Enable 3D"}}, { emu_settings_type::StrictTextureFlushing, { "Video", "Strict Texture Flushing"}}, { emu_settings_type::ForceCPUBlitEmulation, { "Video", "Force CPU Blit"}}, @@ -254,6 +253,7 @@ inline static const QMap settings_location = { emu_settings_type::DisableVulkanMemAllocator, { "Video", "Disable Vulkan Memory Allocator"}}, { emu_settings_type::ShaderMode, { "Video", "Shader Mode"}}, { emu_settings_type::ShaderCompilerNumThreads, { "Video", "Shader Compiler Threads"}}, + { emu_settings_type::ShaderPrecisionQuality, { "Video", "Shader Precision"}}, { emu_settings_type::MultithreadedRSX, { "Video", "Multithreaded RSX"}}, { emu_settings_type::RelaxedZCULL, { "Video", "Relaxed ZCULL Sync"}}, { emu_settings_type::PreciseZCULL, { "Video", "Accurate ZCULL stats"}}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 90383a0ca1..ffa0e0c9f8 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -546,6 +546,9 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std } } + m_emu_settings->EnhanceComboBox(ui->shaderPrecision, emu_settings_type::ShaderPrecisionQuality); + SubscribeTooltip(ui->gb_antiAliasing, tooltips.settings.shader_precision); + // Comboboxes m_emu_settings->EnhanceComboBox(ui->shaderCompilerThreads, emu_settings_type::ShaderCompilerNumThreads, true); SubscribeTooltip(ui->gb_shader_compiler_threads, tooltips.settings.shader_compiler_threads); @@ -2123,9 +2126,6 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_emu_settings->EnhanceCheckBox(ui->strictTextureFlushing, emu_settings_type::StrictTextureFlushing); SubscribeTooltip(ui->strictTextureFlushing, tooltips.settings.strict_texture_flushing); - m_emu_settings->EnhanceCheckBox(ui->disableNativefp16, emu_settings_type::DisableNativefloat16); - SubscribeTooltip(ui->disableNativefp16, tooltips.settings.disable_native_fp16); - m_emu_settings->EnhanceCheckBox(ui->Enable3D, emu_settings_type::Enable3D); SubscribeTooltip(ui->Enable3D, tooltips.settings.enable_3d); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index ee40a3dd29..c4b0636ad0 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -43,8 +43,8 @@ 0 0 - 838 - 641 + 821 + 678 @@ -54,7 +54,7 @@ - 0 + 1 @@ -209,8 +209,8 @@ - 0 - 0 + 0 + 0 @@ -519,7 +519,7 @@ - + 0 @@ -544,6 +544,18 @@ + + + + Shader Quality + + + + + + + + @@ -2537,13 +2549,6 @@ - - - - Disable native float16 support - - - diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index 08f7b11559..367f4a5fe5 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -110,7 +110,6 @@ public: const QString disable_fifo_reordering = tr("Disables RSX FIFO optimizations completely. Draws are processed as they are received by the DMA puller."); const QString gpu_texture_scaling = tr("Force all texture transfer, scaling and conversion operations on the GPU.\nMay cause texture corruption in some cases."); const QString strict_texture_flushing = tr("Forces texture flushing even in situations where it is not necessary/correct. Known to cause visual artifacts, but useful for debugging certain texture cache issues."); - const QString disable_native_fp16 = tr("Disables hardware half-float support which is known to cause problems in some rare cases on some GPUs."); const QString enable_3d = tr("Enables 3D stereo rendering.\nNote that only anaglyph viewing is supported at the moment."); const QString accurate_ppu_128_loop = tr("When enabled, PPU atomic operations will operate on entire cache line data, as opposed to a single 64bit block of memory when disabled.\nNumerical values control whether or not to enable the accurate version based on the atomic operation's length."); const QString enable_performance_report = tr("Measure certain events and print a chart after the emulator is stopped. Don't enable if not asked to."); @@ -176,6 +175,7 @@ public: const QString async_with_shader_interpreter = tr("Hybrid rendering mode.\nIf a shader is not found in the cache, the interpreter will be used to render approximated graphics for this shader until it has compiled."); const QString shader_interpreter_only = tr("All rendering is handled by the interpreter with no attempt to compile native shaders.\nThis mode is very slow and experimental."); const QString shader_compiler_threads = tr("Number of threads to use for the shader compiler backend.\nOnly has an impact when shader mode is set to one of the asynchronous modes."); + const QString shader_precision = tr("Controls the precision level of generated shaders. Low precision leverages native fp16 support of your host GPU but can produce incorrect results in some cases."); const QString async_texture_streaming = tr("Stream textures to GPU in parallel with 3D rendering using asynchronous compute.\nCan improve performance on more powerful GPUs that have spare headroom.\nOnly works with Vulkan renderer and greatly benefits from having MTRSX enabled if you have a capable CPU."); const QString force_disable_exclusive_fullscreen_mode = tr("Forces borderless windowed mode for all fullscreen windows. Disables exclusive fullscreen graphics driver optimizations.\nUse when you wish to stream using Vulkan or if your screen goes dim using HDR.\nNote: RPCS3 does not use HDR at all.");