diff options
author | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-24 17:15:14 +0100 |
---|---|---|
committer | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-24 17:17:48 +0100 |
commit | 13f6a603c212e01cc54b781639316b9741a0f419 (patch) | |
tree | 8c1bac8fff16ac3d18a0956f6912a8b160a881d4 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #1641 from DarkLordZach/sm-register-unregister (diff) | |
download | yuzu-13f6a603c212e01cc54b781639316b9741a0f419.tar yuzu-13f6a603c212e01cc54b781639316b9741a0f419.tar.gz yuzu-13f6a603c212e01cc54b781639316b9741a0f419.tar.bz2 yuzu-13f6a603c212e01cc54b781639316b9741a0f419.tar.lz yuzu-13f6a603c212e01cc54b781639316b9741a0f419.tar.xz yuzu-13f6a603c212e01cc54b781639316b9741a0f419.tar.zst yuzu-13f6a603c212e01cc54b781639316b9741a0f419.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 630a58e49..fea106ba1 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -970,12 +970,20 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, Shader& shader, void RasterizerOpenGL::SyncViewport(OpenGLState& current_state) { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; for (std::size_t i = 0; i < Tegra::Engines::Maxwell3D::Regs::NumViewports; i++) { - const MathUtil::Rectangle<s32> viewport_rect{regs.viewport_transform[i].GetRect()}; auto& viewport = current_state.viewports[i]; - viewport.x = viewport_rect.left; - viewport.y = viewport_rect.bottom; - viewport.width = viewport_rect.GetWidth(); - viewport.height = viewport_rect.GetHeight(); + const auto& src = regs.viewports[i]; + if (regs.viewport_transform_enabled) { + const MathUtil::Rectangle<s32> viewport_rect{regs.viewport_transform[i].GetRect()}; + viewport.x = viewport_rect.left; + viewport.y = viewport_rect.bottom; + viewport.width = viewport_rect.GetWidth(); + viewport.height = viewport_rect.GetHeight(); + } else { + viewport.x = src.x; + viewport.y = src.y; + viewport.width = src.width; + viewport.height = src.height; + } viewport.depth_range_far = regs.viewports[i].depth_range_far; viewport.depth_range_near = regs.viewports[i].depth_range_near; } |