diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index c7a07fdd8..23cef2996 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -61,11 +61,16 @@ struct DrawParams { | |||
| 61 | VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index) { | 61 | VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index) { |
| 62 | const auto& src = regs.viewport_transform[index]; | 62 | const auto& src = regs.viewport_transform[index]; |
| 63 | const float width = src.scale_x * 2.0f; | 63 | const float width = src.scale_x * 2.0f; |
| 64 | const float height = src.scale_y * 2.0f; | 64 | float y = src.translate_y - src.scale_y; |
| 65 | float height = src.scale_y * 2.0f; | ||
| 66 | if (regs.screen_y_control.y_negate) { | ||
| 67 | y += height; | ||
| 68 | height = -height; | ||
| 69 | } | ||
| 65 | const float reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1.0f : 0.0f; | 70 | const float reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1.0f : 0.0f; |
| 66 | VkViewport viewport{ | 71 | VkViewport viewport{ |
| 67 | .x = src.translate_x - src.scale_x, | 72 | .x = src.translate_x - src.scale_x, |
| 68 | .y = src.translate_y - src.scale_y, | 73 | .y = y, |
| 69 | .width = width != 0.0f ? width : 1.0f, | 74 | .width = width != 0.0f ? width : 1.0f, |
| 70 | .height = height != 0.0f ? height : 1.0f, | 75 | .height = height != 0.0f ? height : 1.0f, |
| 71 | .minDepth = src.translate_z - src.scale_z * reduce_z, | 76 | .minDepth = src.translate_z - src.scale_z * reduce_z, |