From cde17e97101c93ffad7d9e6797fe386e656a7721 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 18 Dec 2019 15:28:19 +0000 Subject: [PATCH] Set NEAREST sampling for textures in GL texture zoo * This is needed particularly for integer textures which are incomplete if sampled (even with a non-sampling instruction) with the default LINEAR filtering. --- util/test/demos/gl/gl_texture_zoo.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util/test/demos/gl/gl_texture_zoo.cpp b/util/test/demos/gl/gl_texture_zoo.cpp index 2156f5bb8..0398ca153 100644 --- a/util/test/demos/gl/gl_texture_zoo.cpp +++ b/util/test/demos/gl/gl_texture_zoo.cpp @@ -374,6 +374,15 @@ void main() test.tex = MakeTexture(); glBindTexture(test.target, test.tex); + // MSAA textures don't have sampler state at all + if(!test.isMSAA) + { + // rectangle textures can't have mipmap minification + glTexParameteri(test.target, GL_TEXTURE_MIN_FILTER, + test.isRect ? GL_NEAREST : GL_NEAREST_MIPMAP_NEAREST); + glTexParameteri(test.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + } + if(test.dim == 1) { if(test.isArray)