Check stencil and depth buffer presence before using them in multisample tests.
authorJarkko Pöyry <jpoyry@google.com>
Fri, 3 Apr 2015 03:46:58 +0000 (20:46 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Fri, 3 Apr 2015 18:48:06 +0000 (11:48 -0700)
Bug: 19990776
Change-Id: I4e2e4d43e0a465991fb97a898b5b07e77c30f507

modules/gles2/functional/es2fMultisampleTests.cpp
modules/gles3/functional/es3fMultisampleTests.cpp

index e12972c..2089165 100644 (file)
@@ -901,6 +901,9 @@ void SampleDepthCase::init (void)
 {
        TestLog& log = m_testCtx.getLog();
 
+       if (m_context.getRenderTarget().getDepthBits() == 0)
+               TCU_THROW(NotSupportedError, "Test requires depth buffer");
+
        MultisampleCase::init();
 
        GLU_CHECK_CALL(glEnable(GL_DEPTH_TEST));
@@ -946,6 +949,7 @@ public:
                                                SampleStencilCase               (Context& context, const char* name, const char* description);
                                                ~SampleStencilCase              (void) {}
 
+       void                            init                                    (void);
        IterateResult           iterate                                 (void);
 
 protected:
@@ -957,6 +961,14 @@ SampleStencilCase::SampleStencilCase (Context& context, const char* name, const
 {
 }
 
+void SampleStencilCase::init (void)
+{
+       if (m_context.getRenderTarget().getStencilBits() == 0)
+               TCU_THROW(NotSupportedError, "Test requires stencil buffer");
+
+       MultisampleCase::init();
+}
+
 SampleStencilCase::IterateResult SampleStencilCase::iterate (void)
 {
        TestLog&                log                                     = m_testCtx.getLog();
index b060ed8..64b4777 100644 (file)
@@ -1051,6 +1051,9 @@ void SampleDepthCase::init (void)
 {
        TestLog& log = m_testCtx.getLog();
 
+       if (m_context.getRenderTarget().getDepthBits() == 0)
+               TCU_THROW(NotSupportedError, "Test requires depth buffer");
+
        MultisampleCase::init();
 
        GLU_CHECK_CALL(glEnable(GL_DEPTH_TEST));
@@ -1096,6 +1099,7 @@ public:
                                                SampleStencilCase               (Context& context, const char* name, const char* description, int numFboSamples = 0);
                                                ~SampleStencilCase              (void) {}
 
+       void                            init                                    (void);
        IterateResult           iterate                                 (void);
 };
 
@@ -1104,6 +1108,14 @@ SampleStencilCase::SampleStencilCase (Context& context, const char* name, const
 {
 }
 
+void SampleStencilCase::init (void)
+{
+       if (m_context.getRenderTarget().getStencilBits() == 0)
+               TCU_THROW(NotSupportedError, "Test requires stencil buffer");
+
+       MultisampleCase::init();
+}
+
 SampleStencilCase::IterateResult SampleStencilCase::iterate (void)
 {
        TestLog&                log                                     = m_testCtx.getLog();