diff options
| author | 2023-08-28 01:37:40 +0200 | |
|---|---|---|
| committer | 2023-09-16 11:59:20 -0400 | |
| commit | b99f94a7ffab0698f209bf1b39d337940bc40e50 (patch) | |
| tree | e5d3c3348ea579760276b6d7bb7fd10a98fe0910 /src/video_core | |
| parent | Vulkan: Implement Depth Bias Control (diff) | |
| download | yuzu-b99f94a7ffab0698f209bf1b39d337940bc40e50.tar.gz yuzu-b99f94a7ffab0698f209bf1b39d337940bc40e50.tar.xz yuzu-b99f94a7ffab0698f209bf1b39d337940bc40e50.zip | |
Vulkan: add temporary workaround for AMDVLK
Diffstat (limited to 'src/video_core')
| -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 |
3 files changed, 11 insertions, 2 deletions
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. |