summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 20bb05e7d..87f265e09 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -60,12 +60,18 @@ struct DrawParams {
VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index, float scale) {
const auto& src = regs.viewport_transform[index];
+ const float x = (src.translate_x - src.scale_x) * scale;
const float width = src.scale_x * 2.0f * scale;
- const float height = src.scale_y * 2.0f * scale;
+ float y = (src.translate_y - src.scale_y) * scale;
+ float height = src.scale_y * 2.0f * scale;
+ if (regs.screen_y_control.y_negate) {
+ y += height;
+ height = -height;
+ }
const float reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1.0f : 0.0f;
VkViewport viewport{
- .x = (src.translate_x - src.scale_x) * scale,
- .y = (src.translate_y - src.scale_y) * scale,
+ .x = x,
+ .y = y,
.width = width != 0.0f ? width : 1.0f,
.height = height != 0.0f ? height : 1.0f,
.minDepth = src.translate_z - src.scale_z * reduce_z,