Set NEAREST filtering for sparse clamp lookup texture
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 22 Apr 2022 13:09:31 +0000 (09:09 -0400)
committerPiers Daniell <pdaniell@nvidia.com>
Thu, 12 May 2022 20:55:16 +0000 (14:55 -0600)
Integer formats can't use LINEAR filtering here, so this was
a spec violation.

Given that LINEAR isn't being tested, just use NEAREST in all cases
to avoid complexity.

For the min filter use NEAREST_MIPMAP_NEAREST since mipmaps are used
by the test.

Affects:
KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency
KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor

Components: OpenGL
VK-GL-CTS issue: 3653

Change-Id: I5bb7fcde24c4d3dcf0584bf91e96c4c5559b2b39

external/openglcts/modules/gl/gl4cSparseTextureClampTests.cpp

index b482129053f68a8d35fb547e1be569b10077fe62..3a15bdfae68831445baeaac89f761f29c4565db2 100644 (file)
@@ -411,6 +411,8 @@ bool SparseTextureClampLookupResidencyTestCase::verifyLookupTextureData(const Fu
 
                                gl.bindTexture(target, texture);
                                GLU_EXPECT_NO_ERROR(gl.getError(), "glBindTexture");
+                               gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+                               gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
                                gl.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                                draw(target, z, program);
@@ -922,6 +924,8 @@ bool SparseTextureClampLookupColorTestCase::verifyLookupTextureData(const Functi
 
                                gl.bindTexture(target, texture);
                                GLU_EXPECT_NO_ERROR(gl.getError(), "glBindTexture");
+                               gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+                               gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
                                gl.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                                draw(target, z, program);