Use GL_LINEAR in texture.size tests
authorPyry Haulos <phaulos@google.com>
Tue, 15 Nov 2016 18:36:10 +0000 (10:36 -0800)
committerPyry Haulos <phaulos@google.com>
Tue, 15 Nov 2016 18:43:49 +0000 (13:43 -0500)
Khronos OpenGL issue: #52

Change-Id: I80d240a13231e79504d9e8b5975542bb9e353020

modules/gles2/functional/es2fTextureSizeTests.cpp
modules/gles3/functional/es3fTextureSizeTests.cpp

index 4e2988f..67a57f1 100644 (file)
@@ -125,7 +125,9 @@ Texture2DSizeCase::IterateResult Texture2DSizeCase::iterate (void)
        tcu::RGBA                               threshold               = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
        deUint32                                wrapS                   = GL_CLAMP_TO_EDGE;
        deUint32                                wrapT                   = GL_CLAMP_TO_EDGE;
-       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
+       // Do not minify with GL_NEAREST. A large POT texture with a small POT render target will produce
+       // indeterminate results.
+       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_LINEAR;
        deUint32                                magFilter               = GL_NEAREST;
        vector<float>                   texCoord;
 
@@ -268,7 +270,9 @@ bool TextureCubeSizeCase::testFace (tcu::CubeFace face)
        tcu::RGBA                               threshold               = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
        deUint32                                wrapS                   = GL_CLAMP_TO_EDGE;
        deUint32                                wrapT                   = GL_CLAMP_TO_EDGE;
-       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
+       // Do not minify with GL_NEAREST. A large POT texture with a small POT render target will produce
+       // indeterminate results.
+       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_LINEAR;
        deUint32                                magFilter               = GL_NEAREST;
        vector<float>                   texCoord;
 
index a085d64..09cfd5a 100644 (file)
@@ -126,7 +126,9 @@ Texture2DSizeCase::IterateResult Texture2DSizeCase::iterate (void)
        tcu::RGBA                               threshold               = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
        deUint32                                wrapS                   = GL_CLAMP_TO_EDGE;
        deUint32                                wrapT                   = GL_CLAMP_TO_EDGE;
-       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
+       // Do not minify with GL_NEAREST. A large POT texture with a small POT render target will produce
+       // indeterminate results.
+       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_LINEAR;
        deUint32                                magFilter               = GL_NEAREST;
        vector<float>                   texCoord;
 
@@ -269,7 +271,9 @@ bool TextureCubeSizeCase::testFace (tcu::CubeFace face)
        tcu::RGBA                               threshold               = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
        deUint32                                wrapS                   = GL_CLAMP_TO_EDGE;
        deUint32                                wrapT                   = GL_CLAMP_TO_EDGE;
-       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
+       // Do not minify with GL_NEAREST. A large POT texture with a small POT render target will produce
+       // indeterminate results.
+       deUint32                                minFilter               = m_useMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_LINEAR;
        deUint32                                magFilter               = GL_NEAREST;
        vector<float>                   texCoord;