[Piglit] [PATCH] Use nearest filtering in the texelFetch() and textureSize() tests.
Kenneth Graunke
kenneth at whitecape.org
Tue Mar 20 12:58:39 PDT 2012
According to the OpenGL 3.0 specification, page 214, textures with
internal integer format must use NEAREST for the mag filter and either
NEAREST or NEAREST_MIPMAP_NEAREST for the min filter. Otherwise, the
texture should be incomplete.
Both texelFetch() and textureSize() ignores the filter modes, so there's
no harm in switching to nearest. Obviously we need the texture to be
complete.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
tests/texturing/shaders/texelFetch.c | 4 ++--
tests/texturing/shaders/textureSize.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/texturing/shaders/texelFetch.c b/tests/texturing/shaders/texelFetch.c
index 285f9a2..a310d65 100644
--- a/tests/texturing/shaders/texelFetch.c
+++ b/tests/texturing/shaders/texelFetch.c
@@ -245,8 +245,8 @@ generate_texture()
glGenTextures(1, &tex);
glBindTexture(target, tex);
- glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+ glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
if (swizzling)
diff --git a/tests/texturing/shaders/textureSize.c b/tests/texturing/shaders/textureSize.c
index dfa8a5f..0edb1d2 100644
--- a/tests/texturing/shaders/textureSize.c
+++ b/tests/texturing/shaders/textureSize.c
@@ -139,8 +139,8 @@ generate_texture()
glGenTextures(1, &tex);
glBindTexture(target, tex);
- glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+ glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
--
1.7.7.6
More information about the Piglit
mailing list