diff options
author | Fernando S <fsahmkow27@gmail.com> | 2022-04-07 16:58:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 16:58:59 +0200 |
commit | 03d579418341151da133a41fa7c532a036e0c3a2 (patch) | |
tree | 962142299c2d5599c23030cef535adbcbf761ec6 /src/video_core/renderer_opengl/renderer_opengl.cpp | |
parent | Merge pull request #8150 from liamwhite/vk-crop (diff) | |
parent | OpenGL: fix cropping (diff) | |
download | yuzu-03d579418341151da133a41fa7c532a036e0c3a2.tar yuzu-03d579418341151da133a41fa7c532a036e0c3a2.tar.gz yuzu-03d579418341151da133a41fa7c532a036e0c3a2.tar.bz2 yuzu-03d579418341151da133a41fa7c532a036e0c3a2.tar.lz yuzu-03d579418341151da133a41fa7c532a036e0c3a2.tar.xz yuzu-03d579418341151da133a41fa7c532a036e0c3a2.tar.zst yuzu-03d579418341151da133a41fa7c532a036e0c3a2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index f8f29013a..3a3c213bb 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -208,6 +208,8 @@ void RendererOpenGL::LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuf // Framebuffer orientation handling framebuffer_transform_flags = framebuffer.transform_flags; framebuffer_crop_rect = framebuffer.crop_rect; + framebuffer_width = framebuffer.width; + framebuffer_height = framebuffer.height; const VAddr framebuffer_addr{framebuffer.address + framebuffer.offset}; screen_info.was_accelerated = @@ -480,9 +482,12 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { ASSERT_MSG(framebuffer_crop_rect.top == 0, "Unimplemented"); ASSERT_MSG(framebuffer_crop_rect.left == 0, "Unimplemented"); + f32 scale_u = static_cast<f32>(framebuffer_width) / static_cast<f32>(screen_info.texture.width); + f32 scale_v = + static_cast<f32>(framebuffer_height) / static_cast<f32>(screen_info.texture.height); + // Scale the output by the crop width/height. This is commonly used with 1280x720 rendering // (e.g. handheld mode) on a 1920x1080 framebuffer. - f32 scale_u = 1.f, scale_v = 1.f; if (framebuffer_crop_rect.GetWidth() > 0) { scale_u = static_cast<f32>(framebuffer_crop_rect.GetWidth()) / static_cast<f32>(screen_info.texture.width); |