diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-19 06:03:14 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:30 +0100 |
commit | 122ddeb7ff948a607b0bee9bae968dc4d9c72188 (patch) | |
tree | 0d5936d0666e01cf292e86ace197e754116e500c /src | |
parent | vk_texture_cache: Use nearest neighbor scaling when available (diff) | |
download | yuzu-122ddeb7ff948a607b0bee9bae968dc4d9c72188.tar yuzu-122ddeb7ff948a607b0bee9bae968dc4d9c72188.tar.gz yuzu-122ddeb7ff948a607b0bee9bae968dc4d9c72188.tar.bz2 yuzu-122ddeb7ff948a607b0bee9bae968dc4d9c72188.tar.lz yuzu-122ddeb7ff948a607b0bee9bae968dc4d9c72188.tar.xz yuzu-122ddeb7ff948a607b0bee9bae968dc4d9c72188.tar.zst yuzu-122ddeb7ff948a607b0bee9bae968dc4d9c72188.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 12 |
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, |