summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-07-29 07:17:53 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-07-29 07:17:53 +0200
commitb185567a03aebea36a553254e74e890e5375d370 (patch)
treefd525dcd80caf2087bf51bef51801c69b6b486a3 /src/video_core/renderer_vulkan
parentMerge pull request #6760 from ReinUsesLisp/fp16-collect (diff)
downloadyuzu-b185567a03aebea36a553254e74e890e5375d370.tar
yuzu-b185567a03aebea36a553254e74e890e5375d370.tar.gz
yuzu-b185567a03aebea36a553254e74e890e5375d370.tar.bz2
yuzu-b185567a03aebea36a553254e74e890e5375d370.tar.lz
yuzu-b185567a03aebea36a553254e74e890e5375d370.tar.xz
yuzu-b185567a03aebea36a553254e74e890e5375d370.tar.zst
yuzu-b185567a03aebea36a553254e74e890e5375d370.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp9
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 {
VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index) {
const auto& src = regs.viewport_transform[index];
const float width = src.scale_x * 2.0f;
- const float height = src.scale_y * 2.0f;
+ float y = src.translate_y - src.scale_y;
+ float height = src.scale_y * 2.0f;
+ 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,
- .y = src.translate_y - src.scale_y,
+ .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,