diff options
author | Liam <byteslice@airmail.cc> | 2024-01-27 04:27:34 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-31 17:27:20 +0100 |
commit | 453091f61100effba637950dc840da41d95be477 (patch) | |
tree | 0e1d46a7c5a354769d04b9bde090b5a9b1f02eb7 /src/video_core/renderer_opengl/renderer_opengl.cpp | |
parent | video_core: simplify accelerated surface fetch and crop handling between APIs (diff) | |
download | yuzu-453091f61100effba637950dc840da41d95be477.tar yuzu-453091f61100effba637950dc840da41d95be477.tar.gz yuzu-453091f61100effba637950dc840da41d95be477.tar.bz2 yuzu-453091f61100effba637950dc840da41d95be477.tar.lz yuzu-453091f61100effba637950dc840da41d95be477.tar.xz yuzu-453091f61100effba637950dc840da41d95be477.tar.zst yuzu-453091f61100effba637950dc840da41d95be477.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index ea5ed3e2f..2b9ebff92 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -229,6 +229,8 @@ FramebufferTextureInfo RendererOpenGL::LoadFBToScreenInfo( info.display_texture = framebuffer_texture.resource.handle; info.width = framebuffer.width; info.height = framebuffer.height; + info.scaled_width = framebuffer.width; + info.scaled_height = framebuffer.height; // TODO(Rodrigo): Read this from HLE constexpr u32 block_height_log2 = 4; @@ -476,25 +478,13 @@ void RendererOpenGL::DrawScreen(const Tegra::FramebufferConfig& framebuffer, if (anti_aliasing != Settings::AntiAliasing::None) { glEnablei(GL_SCISSOR_TEST, 0); - auto viewport_width = info.width; - auto scissor_width = static_cast<u32>(crop.GetWidth()); - if (scissor_width <= 0) { - scissor_width = viewport_width; - } - auto viewport_height = info.height; - auto scissor_height = static_cast<u32>(crop.GetHeight()); - if (scissor_height <= 0) { - scissor_height = viewport_height; - } - - viewport_width = Settings::values.resolution_info.ScaleUp(viewport_width); - scissor_width = Settings::values.resolution_info.ScaleUp(scissor_width); - viewport_height = Settings::values.resolution_info.ScaleUp(viewport_height); - scissor_height = Settings::values.resolution_info.ScaleUp(scissor_height); + auto scissor_width = Settings::values.resolution_info.ScaleUp(framebuffer_texture.width); + auto viewport_width = static_cast<GLfloat>(scissor_width); + auto scissor_height = Settings::values.resolution_info.ScaleUp(framebuffer_texture.height); + auto viewport_height = static_cast<GLfloat>(scissor_height); glScissorIndexed(0, 0, 0, scissor_width, scissor_height); - glViewportIndexedf(0, 0.0f, 0.0f, static_cast<GLfloat>(viewport_width), - static_cast<GLfloat>(viewport_height)); + glViewportIndexedf(0, 0.0f, 0.0f, viewport_width, viewport_height); glBindSampler(0, present_sampler.handle); GLint old_read_fb; @@ -557,10 +547,8 @@ void RendererOpenGL::DrawScreen(const Tegra::FramebufferConfig& framebuffer, fsr->InitBuffers(); } - const auto fsr_input_width = Settings::values.resolution_info.ScaleUp(info.width); - const auto fsr_input_height = Settings::values.resolution_info.ScaleUp(info.height); glBindSampler(0, present_sampler.handle); - fsr->Draw(program_manager, layout.screen, fsr_input_width, fsr_input_height, crop); + fsr->Draw(program_manager, layout.screen, info.scaled_width, info.scaled_height, crop); } else { if (fsr->AreBuffersInitialized()) { fsr->ReleaseBuffers(); |