diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-10-17 17:22:16 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:31 +0100 |
commit | b60966041c5b1dccd9c5c5ca00fb02353c2151bb (patch) | |
tree | a4c8e34aadb27e64989a69b3b3b32584e193fab1 /src/video_core/renderer_opengl/renderer_opengl.cpp | |
parent | externals: Add only included ffx-fsr headers (diff) | |
download | yuzu-b60966041c5b1dccd9c5c5ca00fb02353c2151bb.tar yuzu-b60966041c5b1dccd9c5c5ca00fb02353c2151bb.tar.gz yuzu-b60966041c5b1dccd9c5c5ca00fb02353c2151bb.tar.bz2 yuzu-b60966041c5b1dccd9c5c5ca00fb02353c2151bb.tar.lz yuzu-b60966041c5b1dccd9c5c5ca00fb02353c2151bb.tar.xz yuzu-b60966041c5b1dccd9c5c5ca00fb02353c2151bb.tar.zst yuzu-b60966041c5b1dccd9c5c5ca00fb02353c2151bb.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/renderer_opengl.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 955dbc744..68423601c 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -264,6 +264,10 @@ void RendererOpenGL::InitOpenGLObjects() { glSamplerParameteri(present_sampler.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glSamplerParameteri(present_sampler.handle, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + present_sampler_nn.Create(); + glSamplerParameteri(present_sampler_nn.handle, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glSamplerParameteri(present_sampler_nn.handle, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + // Generate VBO handle for drawing vertex_buffer.Create(); @@ -346,6 +350,9 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { 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; @@ -355,6 +362,12 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { 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; @@ -464,7 +477,11 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { } glBindTextureUnit(0, screen_info.display_texture); - glBindSampler(0, present_sampler.handle); + if (Settings::values.scaling_filter.GetValue() != Settings::ScalingFilter::NearestNeighbor) { + glBindSampler(0, present_sampler.handle); + } else { + glBindSampler(0, present_sampler_nn.handle); + } glClear(GL_COLOR_BUFFER_BIT); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); |