summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/present/util.h
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-01-15 21:08:21 +0100
committerLiam <byteslice@airmail.cc>2024-01-31 17:27:21 +0100
commitd4de04584f14f3ea8fde4cd79102b887c084fbc2 (patch)
tree72581b4240726f72d769319f3b5e1b2ece6c8e58 /src/video_core/renderer_opengl/present/util.h
parentrenderer_opengl: move out ownership of FSR resources (diff)
downloadyuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar
yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.gz
yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.bz2
yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.lz
yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.xz
yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.zst
yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.zip
Diffstat (limited to 'src/video_core/renderer_opengl/present/util.h')
-rw-r--r--src/video_core/renderer_opengl/present/util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/present/util.h b/src/video_core/renderer_opengl/present/util.h
index 0aa8b110c..67f03aa27 100644
--- a/src/video_core/renderer_opengl/present/util.h
+++ b/src/video_core/renderer_opengl/present/util.h
@@ -29,4 +29,15 @@ static inline OGLSampler CreateBilinearSampler() {
return sampler;
}
+static inline OGLSampler CreateNearestNeighborSampler() {
+ OGLSampler sampler;
+ sampler.Create();
+ glSamplerParameteri(sampler.handle, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glSamplerParameteri(sampler.handle, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glSamplerParameteri(sampler.handle, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glSamplerParameteri(sampler.handle, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glSamplerParameteri(sampler.handle, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+ return sampler;
+}
+
} // namespace OpenGL