diff options
author | Liam <byteslice@airmail.cc> | 2024-02-24 04:40:48 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-26 17:16:18 +0100 |
commit | 25c3bbba0e46d3a3e8648a310e83c3facdb02a5f (patch) | |
tree | e8621bebad95bfd2d98147b125395f3545cb2627 /src/video_core/renderer_vulkan/vk_rasterizer.cpp | |
parent | video_core: make gpu context aware of rendering program (diff) | |
download | yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar.gz yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar.bz2 yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar.lz yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar.xz yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.tar.zst yuzu-25c3bbba0e46d3a3e8648a310e83c3facdb02a5f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
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) { regs.zeta.format == Tegra::DepthFormat::X8Z24_UNORM || regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM || regs.zeta.format == Tegra::DepthFormat::V8Z24_UNORM; - bool force_unorm = ([&] { - if (!is_d24 || device.SupportsD24DepthBuffer()) { - return false; - } - if (device.IsExtDepthBiasControlSupported()) { - return true; - } + if (is_d24 && !device.SupportsD24DepthBuffer() && program_id == 0x1006A800016E000ULL) { // Only activate this in Super Smash Brothers Ultimate - // Affects AMD cards using AMDVLK - if (program_id != 0x1006A800016E000ULL) { - return false; - } // the base formulas can be obtained from here: // https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias const double rescale_factor = static_cast<double>(1ULL << (32 - 24)) / (static_cast<double>(0x1.ep+127)); units = static_cast<float>(static_cast<double>(units) * rescale_factor); - return false; - })(); + } scheduler.Record([constant = units, clamp = regs.depth_bias_clamp, - factor = regs.slope_scale_depth_bias, force_unorm, - precise = device.HasExactDepthBiasControl()](vk::CommandBuffer cmdbuf) { - if (force_unorm) { - VkDepthBiasRepresentationInfoEXT info{ - .sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT, - .pNext = nullptr, - .depthBiasRepresentation = - VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT, - .depthBiasExact = precise ? VK_TRUE : VK_FALSE, - }; - cmdbuf.SetDepthBias(constant, clamp, factor, &info); - return; - } + factor = regs.slope_scale_depth_bias](vk::CommandBuffer cmdbuf) { cmdbuf.SetDepthBias(constant, clamp, factor); }); } |