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 7fdad38..f722015 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 9f63623..7d14c91 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)");