diff options
author | Liam <byteslice@airmail.cc> | 2024-01-26 22:10:21 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-09 15:20:53 +0100 |
commit | 0cb413c3d31b93ce347e997b9674c304094dab09 (patch) | |
tree | 959ef73963ea1e7975690d31eaf4ddc2f2ad6e19 /src/video_core/renderer_opengl/present/layer.cpp | |
parent | nvnflinger/gpu: implement blending (diff) | |
download | yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar.gz yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar.bz2 yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar.lz yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar.xz yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.tar.zst yuzu-0cb413c3d31b93ce347e997b9674c304094dab09.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/present/layer.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/present/layer.cpp b/src/video_core/renderer_opengl/present/layer.cpp index e3fffaa06..3e4377db4 100644 --- a/src/video_core/renderer_opengl/present/layer.cpp +++ b/src/video_core/renderer_opengl/present/layer.cpp @@ -34,7 +34,7 @@ GLuint Layer::ConfigureDraw(std::array<GLfloat, 3 * 2>& out_matrix, std::array<ScreenRectVertex, 4>& out_vertices, ProgramManager& program_manager, const Tegra::FramebufferConfig& framebuffer, - const Layout::FramebufferLayout& layout) { + const Layout::FramebufferLayout& layout, bool invert_y) { FramebufferTextureInfo info = PrepareRenderTarget(framebuffer); auto crop = Tegra::NormalizeCrop(framebuffer, info.width, info.height); GLuint texture = info.display_texture; @@ -83,10 +83,15 @@ GLuint Layer::ConfigureDraw(std::array<GLfloat, 3 * 2>& out_matrix, const auto w = screen.GetWidth(); const auto h = screen.GetHeight(); - out_vertices[0] = ScreenRectVertex(x, y, crop.left, crop.top); - out_vertices[1] = ScreenRectVertex(x + w, y, crop.right, crop.top); - out_vertices[2] = ScreenRectVertex(x, y + h, crop.left, crop.bottom); - out_vertices[3] = ScreenRectVertex(x + w, y + h, crop.right, crop.bottom); + const auto left = crop.left; + const auto right = crop.right; + const auto top = invert_y ? crop.bottom : crop.top; + const auto bottom = invert_y ? crop.top : crop.bottom; + + out_vertices[0] = ScreenRectVertex(x, y, left, top); + out_vertices[1] = ScreenRectVertex(x + w, y, right, top); + out_vertices[2] = ScreenRectVertex(x, y + h, left, bottom); + out_vertices[3] = ScreenRectVertex(x + w, y + h, right, bottom); return texture; } |