diff options
| author | JPikachu <jpikachu.eden@gmail.com> | 2025-04-08 18:17:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-08 19:17:28 +0200 |
| commit | 52eab40fc8c3896ea34a044f3ceb6a130f017d25 (patch) | |
| tree | 7d129bf24563ced0e6093eddb671e8a1173711d4 /src/video_core/renderer_vulkan/vk_rasterizer.cpp | |
| parent | 6f45ab5344832b763bda065e480951c90a39dd23 (diff) | |
Implement LogicOP Workaround for Vulkan on AMD GPUs
This fixes black sewers in Paper Mario: TTYD
Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_rasterizer.cpp')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 8ba50a8344..d0cff37f61 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -952,7 +952,28 @@ void RasterizerVulkan::UpdateDynamicStates() { UpdateDepthBiasEnable(regs); } if (device.IsExtExtendedDynamicState3EnablesSupported()) { - UpdateLogicOpEnable(regs); + using namespace Tegra::Engines;
+
+ if (device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_OPEN_SOURCE
+ || device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_PROPRIETARY) {
+ struct In {
+ const Maxwell3D::Regs::VertexAttribute::Type d;
+ In(Maxwell3D::Regs::VertexAttribute::Type n) : d(n) {}
+ bool operator()(Maxwell3D::Regs::VertexAttribute n) const {
+ return n.type == d;
+ }
+ };
+
+ auto has_float = std::any_of(
+ regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(),
+ In(Maxwell3D::Regs::VertexAttribute::Type::Float));
+
+ if (regs.logic_op.enable)
+ regs.logic_op.enable = static_cast<u32>(!has_float);
+
+ UpdateLogicOpEnable(regs);
+ } else
+ UpdateLogicOpEnable(regs);
UpdateDepthClampEnable(regs); } } |
