diff options
| -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 | |||
| 75 | const float width = conv(src.scale_x * 2.0f); | 75 | const float width = conv(src.scale_x * 2.0f); |
| 76 | float y = conv(src.translate_y - src.scale_y); | 76 | float y = conv(src.translate_y - src.scale_y); |
| 77 | float height = conv(src.scale_y * 2.0f); | 77 | float height = conv(src.scale_y * 2.0f); |
| 78 | bool y_negate = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; | ||
| 79 | 78 | ||
| 80 | if (!device.IsNvViewportSwizzleSupported()) { | 79 | const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; |
| 81 | y_negate = y_negate != (src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY); | 80 | const bool y_negate = !device.IsNvViewportSwizzleSupported() && |
| 81 | src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY; | ||
| 82 | |||
| 83 | if (lower_left) { | ||
| 84 | // Flip by surface clip height | ||
| 85 | y += conv(static_cast<f32>(regs.surface_clip.height)); | ||
| 86 | height = -height; | ||
| 82 | } | 87 | } |
| 83 | 88 | ||
| 84 | if (y_negate) { | 89 | if (y_negate) { |
| 85 | y += conv(static_cast<f32>(regs.surface_clip.height)); | 90 | // Flip by viewport height |
| 91 | y += height; | ||
| 86 | height = -height; | 92 | height = -height; |
| 87 | } | 93 | } |
| 88 | 94 | ||