diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-14 09:44:34 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-14 09:44:34 +0200 |
commit | 37e5c4fa7cd8adfce819f47cb98dedd1f4186475 (patch) | |
tree | 5bf293c40a28ffa5affdaa0dd41c70daf6d07441 | |
parent | Merge pull request #3636 from ReinUsesLisp/drop-vk-hpp (diff) | |
download | yuzu-37e5c4fa7cd8adfce819f47cb98dedd1f4186475.tar yuzu-37e5c4fa7cd8adfce819f47cb98dedd1f4186475.tar.gz yuzu-37e5c4fa7cd8adfce819f47cb98dedd1f4186475.tar.bz2 yuzu-37e5c4fa7cd8adfce819f47cb98dedd1f4186475.tar.lz yuzu-37e5c4fa7cd8adfce819f47cb98dedd1f4186475.tar.xz yuzu-37e5c4fa7cd8adfce819f47cb98dedd1f4186475.tar.zst yuzu-37e5c4fa7cd8adfce819f47cb98dedd1f4186475.zip |
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 33cbc0bb6..774ba1f26 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -62,13 +62,16 @@ constexpr auto ComputeShaderIndex = static_cast<std::size_t>(Tegra::Engines::Sha VkViewport GetViewportState(const VKDevice& device, const Maxwell& regs, std::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; + VkViewport viewport; viewport.x = src.translate_x - src.scale_x; viewport.y = src.translate_y - src.scale_y; - viewport.width = src.scale_x * 2.0f; - viewport.height = src.scale_y * 2.0f; + viewport.width = width != 0.0f ? width : 1.0f; + viewport.height = height != 0.0f ? height : 1.0f; - const float reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne; + const float reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1.0f : 0.0f; viewport.minDepth = src.translate_z - src.scale_z * reduce_z; viewport.maxDepth = src.translate_z + src.scale_z; if (!device.IsExtDepthRangeUnrestrictedSupported()) { |