diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/core/core.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 3 |
5 files changed, 20 insertions, 2 deletions
diff --git a/src/common/settings.h b/src/common/settings.h index 82ec9077e..6f050c89d 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -350,6 +350,8 @@ struct Values { | |||
| 350 | linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug}; | 350 | linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug}; |
| 351 | Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey", | 351 | Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey", |
| 352 | Category::RendererDebug}; | 352 | Category::RendererDebug}; |
| 353 | // TODO: remove this once AMDVLK supports VK_EXT_depth_bias_control | ||
| 354 | bool renderer_amdvlk_depth_bias_workaround{}; | ||
| 353 | 355 | ||
| 354 | // System | 356 | // System |
| 355 | SwitchableSetting<Language, true> language_index{linkage, | 357 | SwitchableSetting<Language, true> language_index{linkage, |
diff --git a/src/core/core.cpp b/src/core/core.cpp index e8300cd05..08cbb8978 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -381,6 +381,10 @@ struct System::Impl { | |||
| 381 | room_member->SendGameInfo(game_info); | 381 | room_member->SendGameInfo(game_info); |
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | // Workarounds: | ||
| 385 | // Activate this in Super Smash Brothers Ultimate, it only affects AMD cards using AMDVLK | ||
| 386 | Settings::values.renderer_amdvlk_depth_bias_workaround = program_id == 0x1006A800016E000ULL; | ||
| 387 | |||
| 384 | status = SystemResultStatus::Success; | 388 | status = SystemResultStatus::Success; |
| 385 | return status; | 389 | return status; |
| 386 | } | 390 | } |
| @@ -440,6 +444,9 @@ struct System::Impl { | |||
| 440 | room_member->SendGameInfo(game_info); | 444 | room_member->SendGameInfo(game_info); |
| 441 | } | 445 | } |
| 442 | 446 | ||
| 447 | // Workarounds | ||
| 448 | Settings::values.renderer_amdvlk_depth_bias_workaround = false; | ||
| 449 | |||
| 443 | LOG_DEBUG(Core, "Shutdown OK"); | 450 | LOG_DEBUG(Core, "Shutdown OK"); |
| 444 | } | 451 | } |
| 445 | 452 | ||
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 0201c4d08..59b87807b 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -1050,6 +1050,9 @@ void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D::Regs& regs) { | |||
| 1050 | if (device.IsExtDepthBiasControlSupported()) { | 1050 | if (device.IsExtDepthBiasControlSupported()) { |
| 1051 | return true; | 1051 | return true; |
| 1052 | } | 1052 | } |
| 1053 | if (!Settings::values.renderer_amdvlk_depth_bias_workaround) { | ||
| 1054 | return false; | ||
| 1055 | } | ||
| 1053 | // the base formulas can be obtained from here: | 1056 | // the base formulas can be obtained from here: |
| 1054 | // https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias | 1057 | // https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias |
| 1055 | const double rescale_factor = | 1058 | const double rescale_factor = |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 617417040..835a1338b 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -1051,6 +1051,13 @@ void Device::RemoveUnsuitableExtensions() { | |||
| 1051 | RemoveExtensionFeatureIfUnsuitable(extensions.custom_border_color, features.custom_border_color, | 1051 | RemoveExtensionFeatureIfUnsuitable(extensions.custom_border_color, features.custom_border_color, |
| 1052 | VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); | 1052 | VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); |
| 1053 | 1053 | ||
| 1054 | // VK_EXT_depth_bias_control | ||
| 1055 | extensions.depth_bias_control = | ||
| 1056 | features.depth_bias_control.depthBiasControl && | ||
| 1057 | features.depth_bias_control.leastRepresentableValueForceUnormRepresentation; | ||
| 1058 | RemoveExtensionFeatureIfUnsuitable(extensions.depth_bias_control, features.depth_bias_control, | ||
| 1059 | VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME); | ||
| 1060 | |||
| 1054 | // VK_EXT_depth_clip_control | 1061 | // VK_EXT_depth_clip_control |
| 1055 | extensions.depth_clip_control = features.depth_clip_control.depthClipControl; | 1062 | extensions.depth_clip_control = features.depth_clip_control.depthClipControl; |
| 1056 | RemoveExtensionFeatureIfUnsuitable(extensions.depth_clip_control, features.depth_clip_control, | 1063 | RemoveExtensionFeatureIfUnsuitable(extensions.depth_clip_control, features.depth_clip_control, |
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 2063f58b5..eb314fe33 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -456,8 +456,7 @@ public: | |||
| 456 | 456 | ||
| 457 | /// Returns true if the device supports VK_EXT_depth_bias_control. | 457 | /// Returns true if the device supports VK_EXT_depth_bias_control. |
| 458 | bool IsExtDepthBiasControlSupported() const { | 458 | bool IsExtDepthBiasControlSupported() const { |
| 459 | return extensions.depth_bias_control && features.depth_bias_control.depthBiasControl && | 459 | return extensions.depth_bias_control; |
| 460 | features.depth_bias_control.leastRepresentableValueForceUnormRepresentation; | ||
| 461 | } | 460 | } |
| 462 | 461 | ||
| 463 | /// Returns true if the device supports VK_EXT_shader_viewport_index_layer. | 462 | /// Returns true if the device supports VK_EXT_shader_viewport_index_layer. |