summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmeer J <52414509+ameerj@users.noreply.github.com>2021-08-01 07:47:37 +0200
committerGitHub <noreply@github.com>2021-08-01 07:47:37 +0200
commitdb32c3762bda2e0c8e9698783042aa0e1c0f04c1 (patch)
treef6e6396aff47d9270f4ef7d2a1f8d91562a186e3
parentMerge pull request #6565 from lat9nq/bundle-ffmpeg (diff)
parentvk_rasterizer: Flip viewport on Y_NEGATE (diff)
downloadyuzu-db32c3762bda2e0c8e9698783042aa0e1c0f04c1.tar
yuzu-db32c3762bda2e0c8e9698783042aa0e1c0f04c1.tar.gz
yuzu-db32c3762bda2e0c8e9698783042aa0e1c0f04c1.tar.bz2
yuzu-db32c3762bda2e0c8e9698783042aa0e1c0f04c1.tar.lz
yuzu-db32c3762bda2e0c8e9698783042aa0e1c0f04c1.tar.xz
yuzu-db32c3762bda2e0c8e9698783042aa0e1c0f04c1.tar.zst
yuzu-db32c3762bda2e0c8e9698783042aa0e1c0f04c1.zip
-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,