Merge "Check if RGBA32F is color renderable and texture filterable."
authorMika Isojärvi <misojarvi@google.com>
Tue, 24 Feb 2015 17:46:13 +0000 (17:46 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 24 Feb 2015 17:46:14 +0000 (17:46 +0000)
modules/gles3/functional/es3fNegativeTextureApiTests.cpp
modules/gles31/functional/es31fNegativeTextureApiTests.cpp

index 91fdd71..5be4cc0 100644 (file)
@@ -994,9 +994,14 @@ void NegativeTextureApiTests::init (void)
                        glTexImage2D(GL_TEXTURE_2D, 0, GL_R8I, 0, 0, 0, GL_RED_INTEGER, GL_BYTE, 0);
                        glGenerateMipmap(GL_TEXTURE_2D);
                        expectError(GL_INVALID_OPERATION);
-                       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 0, 0, 0, GL_RGBA, GL_FLOAT, 0);
-                       glGenerateMipmap(GL_TEXTURE_2D);
-                       expectError(GL_INVALID_OPERATION);
+
+                       if (!(m_context.getContextInfo().isExtensionSupported("GL_EXT_color_buffer_float") && m_context.getContextInfo().isExtensionSupported("GL_OES_texture_float_linear")))
+                       {
+                               glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 0, 0, 0, GL_RGBA, GL_FLOAT, 0);
+                               glGenerateMipmap(GL_TEXTURE_2D);
+                               expectError(GL_INVALID_OPERATION);
+                       }
+
                        m_log << TestLog::EndSection;
 
                        glDeleteTextures(2, texture);
index e0fddfa..f49ea1a 100644 (file)
@@ -25,6 +25,7 @@
 #include "es31fNegativeTestShared.hpp"
 
 #include "gluCallLogWrapper.hpp"
+#include "gluContextInfo.hpp"
 
 #include "glwDefs.hpp"
 #include "glwEnums.hpp"
@@ -1002,9 +1003,14 @@ void generatemipmap (NegativeTestContext& ctx)
        ctx.glTexImage2D(GL_TEXTURE_2D, 0, GL_R8I, 0, 0, 0, GL_RED_INTEGER, GL_BYTE, 0);
        ctx.glGenerateMipmap(GL_TEXTURE_2D);
        ctx.expectError(GL_INVALID_OPERATION);
-       ctx.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 0, 0, 0, GL_RGBA, GL_FLOAT, 0);
-       ctx.glGenerateMipmap(GL_TEXTURE_2D);
-       ctx.expectError(GL_INVALID_OPERATION);
+
+       if (!(ctx.getContextInfo().isExtensionSupported("GL_EXT_color_buffer_float") && ctx.getContextInfo().isExtensionSupported("GL_OES_texture_float_linear")))
+       {
+               ctx.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 0, 0, 0, GL_RGBA, GL_FLOAT, 0);
+               ctx.glGenerateMipmap(GL_TEXTURE_2D);
+               ctx.expectError(GL_INVALID_OPERATION);
+       }
+
        ctx.endSection();
 
        ctx.glDeleteTextures(2, texture);