diff options
| author | 2024-02-23 22:40:48 -0500 | |
|---|---|---|
| committer | 2024-02-26 11:16:18 -0500 | |
| commit | 25c3bbba0e46d3a3e8648a310e83c3facdb02a5f (patch) | |
| tree | e8621bebad95bfd2d98147b125395f3545cb2627 /src | |
| parent | video_core: make gpu context aware of rendering program (diff) | |
| download | yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar.gz yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar.xz yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.zip | |
settings: remove global override for smash on amdvlk
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/core/core.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 29 |
3 files changed, 3 insertions, 36 deletions
diff --git a/src/common/settings.h b/src/common/settings.h index b2b071e7e..fa2d08da1 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -435,8 +435,6 @@ struct Values { | |||
| 435 | linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug}; | 435 | linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug}; |
| 436 | Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey", | 436 | Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey", |
| 437 | Category::RendererDebug}; | 437 | Category::RendererDebug}; |
| 438 | // TODO: remove this once AMDVLK supports VK_EXT_depth_bias_control | ||
| 439 | bool renderer_amdvlk_depth_bias_workaround{}; | ||
| 440 | Setting<bool> disable_buffer_reorder{linkage, false, "disable_buffer_reorder", | 438 | Setting<bool> disable_buffer_reorder{linkage, false, "disable_buffer_reorder", |
| 441 | Category::RendererDebug}; | 439 | Category::RendererDebug}; |
| 442 | 440 | ||
diff --git a/src/core/core.cpp b/src/core/core.cpp index 9e8936728..dc515bc82 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -425,11 +425,6 @@ struct System::Impl { | |||
| 425 | room_member->SendGameInfo(game_info); | 425 | room_member->SendGameInfo(game_info); |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | // Workarounds: | ||
| 429 | // Activate this in Super Smash Brothers Ultimate, it only affects AMD cards using AMDVLK | ||
| 430 | Settings::values.renderer_amdvlk_depth_bias_workaround = | ||
| 431 | params.program_id == 0x1006A800016E000ULL; | ||
| 432 | |||
| 433 | status = SystemResultStatus::Success; | 428 | status = SystemResultStatus::Success; |
| 434 | return status; | 429 | return status; |
| 435 | } | 430 | } |
| @@ -489,9 +484,6 @@ struct System::Impl { | |||
| 489 | room_member->SendGameInfo(game_info); | 484 | room_member->SendGameInfo(game_info); |
| 490 | } | 485 | } |
| 491 | 486 | ||
| 492 | // Workarounds | ||
| 493 | Settings::values.renderer_amdvlk_depth_bias_workaround = false; | ||
| 494 | |||
| 495 | LOG_DEBUG(Core, "Shutdown OK"); | 487 | LOG_DEBUG(Core, "Shutdown OK"); |
| 496 | } | 488 | } |
| 497 | 489 | ||
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 6cfec2e6f..84955bdc8 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -1054,39 +1054,16 @@ void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D::Regs& regs) { | |||
| 1054 | regs.zeta.format == Tegra::DepthFormat::X8Z24_UNORM || | 1054 | regs.zeta.format == Tegra::DepthFormat::X8Z24_UNORM || |
| 1055 | regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM || | 1055 | regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM || |
| 1056 | regs.zeta.format == Tegra::DepthFormat::V8Z24_UNORM; | 1056 | regs.zeta.format == Tegra::DepthFormat::V8Z24_UNORM; |
| 1057 | bool force_unorm = ([&] { | 1057 | if (is_d24 && !device.SupportsD24DepthBuffer() && program_id == 0x1006A800016E000ULL) { |
| 1058 | if (!is_d24 || device.SupportsD24DepthBuffer()) { | ||
| 1059 | return false; | ||
| 1060 | } | ||
| 1061 | if (device.IsExtDepthBiasControlSupported()) { | ||
| 1062 | return true; | ||
| 1063 | } | ||
| 1064 | // Only activate this in Super Smash Brothers Ultimate | 1058 | // Only activate this in Super Smash Brothers Ultimate |
| 1065 | // Affects AMD cards using AMDVLK | ||
| 1066 | if (program_id != 0x1006A800016E000ULL) { | ||
| 1067 | return false; | ||
| 1068 | } | ||
| 1069 | // the base formulas can be obtained from here: | 1059 | // the base formulas can be obtained from here: |
| 1070 | // https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias | 1060 | // https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias |
| 1071 | const double rescale_factor = | 1061 | const double rescale_factor = |
| 1072 | static_cast<double>(1ULL << (32 - 24)) / (static_cast<double>(0x1.ep+127)); | 1062 | static_cast<double>(1ULL << (32 - 24)) / (static_cast<double>(0x1.ep+127)); |
| 1073 | units = static_cast<float>(static_cast<double>(units) * rescale_factor); | 1063 | units = static_cast<float>(static_cast<double>(units) * rescale_factor); |
| 1074 | return false; | 1064 | } |
| 1075 | })(); | ||
| 1076 | scheduler.Record([constant = units, clamp = regs.depth_bias_clamp, | 1065 | scheduler.Record([constant = units, clamp = regs.depth_bias_clamp, |
| 1077 | factor = regs.slope_scale_depth_bias, force_unorm, | 1066 | factor = regs.slope_scale_depth_bias](vk::CommandBuffer cmdbuf) { |
| 1078 | precise = device.HasExactDepthBiasControl()](vk::CommandBuffer cmdbuf) { | ||
| 1079 | if (force_unorm) { | ||
| 1080 | VkDepthBiasRepresentationInfoEXT info{ | ||
| 1081 | .sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT, | ||
| 1082 | .pNext = nullptr, | ||
| 1083 | .depthBiasRepresentation = | ||
| 1084 | VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT, | ||
| 1085 | .depthBiasExact = precise ? VK_TRUE : VK_FALSE, | ||
| 1086 | }; | ||
| 1087 | cmdbuf.SetDepthBias(constant, clamp, factor, &info); | ||
| 1088 | return; | ||
| 1089 | } | ||
| 1090 | cmdbuf.SetDepthBias(constant, clamp, factor); | 1067 | cmdbuf.SetDepthBias(constant, clamp, factor); |
| 1091 | }); | 1068 | }); |
| 1092 | } | 1069 | } |