summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-11-21 08:33:57 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-12-05 21:42:45 +0100
commitc22c4f5d599406fa32535e56bf5e3c843d29a2df (patch)
tree9448aab72c446e163d371a3b7fd7d10bc1071268 /src
parenttexture_cache: Fix image convert dimensions assertion (diff)
downloadyuzu-c22c4f5d599406fa32535e56bf5e3c843d29a2df.tar
yuzu-c22c4f5d599406fa32535e56bf5e3c843d29a2df.tar.gz
yuzu-c22c4f5d599406fa32535e56bf5e3c843d29a2df.tar.bz2
yuzu-c22c4f5d599406fa32535e56bf5e3c843d29a2df.tar.lz
yuzu-c22c4f5d599406fa32535e56bf5e3c843d29a2df.tar.xz
yuzu-c22c4f5d599406fa32535e56bf5e3c843d29a2df.tar.zst
yuzu-c22c4f5d599406fa32535e56bf5e3c843d29a2df.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp50
1 files changed, 20 insertions, 30 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 28daacd82..f81c1b233 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -437,39 +437,29 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
glBindTextureUnit(0, fxaa_texture.handle);
}
-
- // Set projection matrix
const std::array ortho_matrix =
MakeOrthographicMatrix(static_cast<float>(layout.width), static_cast<float>(layout.height));
- GLuint fragment_handle;
- const auto filter = Settings::values.scaling_filter.GetValue();
- switch (filter) {
- case Settings::ScalingFilter::NearestNeighbor:
- fragment_handle = present_bilinear_fragment.handle;
- break;
- case Settings::ScalingFilter::Bilinear:
- fragment_handle = present_bilinear_fragment.handle;
- break;
- case Settings::ScalingFilter::Bicubic:
- fragment_handle = present_bicubic_fragment.handle;
- break;
- case Settings::ScalingFilter::Gaussian:
- fragment_handle = present_gaussian_fragment.handle;
- break;
- case Settings::ScalingFilter::ScaleForce:
- fragment_handle = present_scaleforce_fragment.handle;
- break;
- case Settings::ScalingFilter::Fsr:
- LOG_WARNING(
- Render_OpenGL,
- "FidelityFX FSR Super Sampling is not supported in OpenGL, changing to ScaleForce");
- fragment_handle = present_scaleforce_fragment.handle;
- break;
- default:
- fragment_handle = present_bilinear_fragment.handle;
- break;
- }
+ const auto fragment_handle = [this]() {
+ switch (Settings::values.scaling_filter.GetValue()) {
+ case Settings::ScalingFilter::NearestNeighbor:
+ case Settings::ScalingFilter::Bilinear:
+ return present_bilinear_fragment.handle;
+ case Settings::ScalingFilter::Bicubic:
+ return present_bicubic_fragment.handle;
+ case Settings::ScalingFilter::Gaussian:
+ return present_gaussian_fragment.handle;
+ case Settings::ScalingFilter::ScaleForce:
+ return present_scaleforce_fragment.handle;
+ case Settings::ScalingFilter::Fsr:
+ LOG_WARNING(
+ Render_OpenGL,
+ "FidelityFX Super Resolution is not supported in OpenGL, changing to ScaleForce");
+ return present_scaleforce_fragment.handle;
+ default:
+ return present_bilinear_fragment.handle;
+ }
+ }();
program_manager.BindPresentPrograms(present_vertex.handle, fragment_handle);
glProgramUniformMatrix3x2fv(present_vertex.handle, ModelViewMatrixLocation, 1, GL_FALSE,
ortho_matrix.data());