summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/present/util.h
diff options
context:
space:
mode:
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