diff options
author | Liam <byteslice@airmail.cc> | 2023-11-30 18:33:26 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-11-30 18:33:26 +0100 |
commit | e7dd968ac40ba10dc644ccc7269c6f77b8c734a9 (patch) | |
tree | 3ccc98a35b4799927dd77a8c386bac29f157a854 /src/video_core | |
parent | Merge pull request #12229 from liamwhite/qcom-wtf (diff) | |
download | yuzu-e7dd968ac40ba10dc644ccc7269c6f77b8c734a9.tar yuzu-e7dd968ac40ba10dc644ccc7269c6f77b8c734a9.tar.gz yuzu-e7dd968ac40ba10dc644ccc7269c6f77b8c734a9.tar.bz2 yuzu-e7dd968ac40ba10dc644ccc7269c6f77b8c734a9.tar.lz yuzu-e7dd968ac40ba10dc644ccc7269c6f77b8c734a9.tar.xz yuzu-e7dd968ac40ba10dc644ccc7269c6f77b8c734a9.tar.zst yuzu-e7dd968ac40ba10dc644ccc7269c6f77b8c734a9.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 07222e603..b6f52e017 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -75,14 +75,20 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in const float width = conv(src.scale_x * 2.0f); float y = conv(src.translate_y - src.scale_y); float height = conv(src.scale_y * 2.0f); - bool y_negate = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; - if (!device.IsNvViewportSwizzleSupported()) { - y_negate = y_negate != (src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY); + const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; + const bool y_negate = !device.IsNvViewportSwizzleSupported() && + src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY; + + if (lower_left) { + // Flip by surface clip height + y += conv(static_cast<f32>(regs.surface_clip.height)); + height = -height; } if (y_negate) { - y += conv(static_cast<f32>(regs.surface_clip.height)); + // Flip by viewport height + y += height; height = -height; } |