summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorvonchenplus <vonchenplus@gmail.com>2022-08-20 10:58:01 +0200
committervonchenplus <vonchenplus@gmail.com>2022-08-20 15:41:40 +0200
commit0a8c5c8622de649ed3cf2523f7ca77274832b957 (patch)
tree12bcf92996fdd8aeff46990278b68a28b0a32016 /src/video_core/renderer_opengl
parentMerge pull request #8791 from liamwhite/r16g16b16x16 (diff)
downloadyuzu-0a8c5c8622de649ed3cf2523f7ca77274832b957.tar
yuzu-0a8c5c8622de649ed3cf2523f7ca77274832b957.tar.gz
yuzu-0a8c5c8622de649ed3cf2523f7ca77274832b957.tar.bz2
yuzu-0a8c5c8622de649ed3cf2523f7ca77274832b957.tar.lz
yuzu-0a8c5c8622de649ed3cf2523f7ca77274832b957.tar.xz
yuzu-0a8c5c8622de649ed3cf2523f7ca77274832b957.tar.zst
yuzu-0a8c5c8622de649ed3cf2523f7ca77274832b957.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 01028cee0..34f3f7a67 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -478,13 +478,16 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
}
}
- ASSERT_MSG(framebuffer_crop_rect.top == 0, "Unimplemented");
ASSERT_MSG(framebuffer_crop_rect.left == 0, "Unimplemented");
+ f32 left_start{};
+ if (framebuffer_crop_rect.Top() > 0) {
+ left_start = static_cast<f32>(framebuffer_crop_rect.Top()) /
+ static_cast<f32>(framebuffer_crop_rect.Bottom());
+ }
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.
if (framebuffer_crop_rect.GetWidth() > 0) {
@@ -503,10 +506,14 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
const auto& screen = layout.screen;
const std::array vertices = {
- ScreenRectVertex(screen.left, screen.top, texcoords.top * scale_u, left * scale_v),
- ScreenRectVertex(screen.right, screen.top, texcoords.bottom * scale_u, left * scale_v),
- ScreenRectVertex(screen.left, screen.bottom, texcoords.top * scale_u, right * scale_v),
- ScreenRectVertex(screen.right, screen.bottom, texcoords.bottom * scale_u, right * scale_v),
+ ScreenRectVertex(screen.left, screen.top, texcoords.top * scale_u,
+ left_start + left * scale_v),
+ ScreenRectVertex(screen.right, screen.top, texcoords.bottom * scale_u,
+ left_start + left * scale_v),
+ ScreenRectVertex(screen.left, screen.bottom, texcoords.top * scale_u,
+ left_start + right * scale_v),
+ ScreenRectVertex(screen.right, screen.bottom, texcoords.bottom * scale_u,
+ left_start + right * scale_v),
};
glNamedBufferSubData(vertex_buffer.handle, 0, sizeof(vertices), std::data(vertices));