Check existence of GL_EXT_render_snorm in negative tests.
authorMika Isojärvi <misojarvi@google.com>
Mon, 23 Feb 2015 18:34:38 +0000 (10:34 -0800)
committerMika Isojärvi <misojarvi@google.com>
Mon, 23 Feb 2015 18:36:50 +0000 (10:36 -0800)
Check if extension GL_EXT_render_snorm exists before assuming that setting
renderbuffer storage to signed normalized format fails.

Bug: 19462857
Change-Id: I0d0b14ecd0cc7952dbf163c67ed8c1bdb83f2d08

modules/gles3/functional/es3fNegativeBufferApiTests.cpp
modules/gles31/functional/es31fNegativeBufferApiTests.cpp

index 7fdad3811dc7c2efc63151d8e13d8e0f1942af38..f7220157111d83f97a147da14ccd9c76fe88c4db 100644 (file)
@@ -1059,8 +1059,12 @@ void NegativeBufferApiTests::init (void)
                                expectError                             (GL_INVALID_ENUM);
                        }
 
-                       glRenderbufferStorage   (GL_RENDERBUFFER, GL_RGBA8_SNORM, 1, 1);
-                       expectError                             (GL_INVALID_ENUM);
+                       if (!m_context.getContextInfo().isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error
+                       {
+                               glRenderbufferStorage   (GL_RENDERBUFFER, GL_RGBA8_SNORM, 1, 1);
+                               expectError                             (GL_INVALID_ENUM);
+                       }
+
                        m_log << TestLog::EndSection;
 
                        m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if width or height is less than zero.");
@@ -1392,8 +1396,12 @@ void NegativeBufferApiTests::init (void)
                                expectError                                                     (GL_INVALID_ENUM);
                        }
 
-                       glRenderbufferStorageMultisample        (GL_RENDERBUFFER, 2, GL_RGBA8_SNORM, 1, 1);
-                       expectError                                                     (GL_INVALID_ENUM);
+                       if (!m_context.getContextInfo().isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error
+                       {
+                               glRenderbufferStorageMultisample        (GL_RENDERBUFFER, 2, GL_RGBA8_SNORM, 1, 1);
+                               expectError                                                     (GL_INVALID_ENUM);
+                       }
+
                        m_log << TestLog::EndSection;
 
                        m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if width or height is less than zero.");
index 9f636238cbb40e64aa45849e38bc2e814ae9d08b..7d14c9112ad88f7518182fec556de4216f407636 100644 (file)
@@ -1084,8 +1084,12 @@ void renderbuffer_storage (NegativeTestContext& ctx)
                ctx.expectError                         (GL_INVALID_ENUM);
        }
 
-       ctx.glRenderbufferStorage       (GL_RENDERBUFFER, GL_RGBA8_SNORM, 1, 1);
-       ctx.expectError                         (GL_INVALID_ENUM);
+       if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error
+       {
+               ctx.glRenderbufferStorage       (GL_RENDERBUFFER, GL_RGBA8_SNORM, 1, 1);
+               ctx.expectError                         (GL_INVALID_ENUM);
+       }
+
        ctx.endSection();
 
        ctx.beginSection("GL_INVALID_VALUE is generated if width or height is less than zero.");
@@ -1426,8 +1430,12 @@ void renderbuffer_storage_multisample (NegativeTestContext& ctx)
                ctx.expectError                                                 (GL_INVALID_ENUM);
        }
 
-       ctx.glRenderbufferStorageMultisample    (GL_RENDERBUFFER, 2, GL_RGBA8_SNORM, 1, 1);
-       ctx.expectError                                                 (GL_INVALID_ENUM);
+       if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error
+       {
+               ctx.glRenderbufferStorageMultisample    (GL_RENDERBUFFER, 2, GL_RGBA8_SNORM, 1, 1);
+               ctx.expectError                                                 (GL_INVALID_ENUM);
+       }
+
        ctx.endSection();
 
        ctx.beginSection("GL_INVALID_OPERATION is generated if samples is greater than the maximum number of samples supported for internalformat. (Unsigned integer format)");