Fix PIPELINE_STAGE_TOP_OF_PIPE_BIT usage in api tests
[platform/upstream/VK-GL-CTS.git] / modules / gles31 / functional / es31fDebugTests.cpp
index d6dde30..4a507cc 100644 (file)
 #include "es31fNegativeShaderImageLoadStoreTests.hpp"
 #include "es31fNegativeShaderFunctionTests.hpp"
 #include "es31fNegativeShaderDirectiveTests.hpp"
+#include "es31fNegativeSSBOBlockTests.hpp"
 #include "es31fNegativePreciseTests.hpp"
 #include "es31fNegativeAdvancedBlendEquationTests.hpp"
+#include "es31fNegativeShaderStorageTests.hpp"
+#include "es31fNegativeTessellationTests.hpp"
+#include "es31fNegativeComputeTests.hpp"
+#include "es31fNegativeSampleVariablesTests.hpp"
+#include "es31fNegativeShaderFramebufferFetchTests.hpp"
 
 #include "deUniquePtr.hpp"
 #include "deRandom.hpp"
@@ -105,8 +111,8 @@ static const GLenum s_debugSeverities[] =
 
 static bool isKHRDebugSupported (Context& ctx)
 {
-       const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
-       return isES32 || ctx.getContextInfo().isExtensionSupported("GL_KHR_debug");
+       const bool supportsES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
+       return supportsES32 || ctx.getContextInfo().isExtensionSupported("GL_KHR_debug");
 }
 
 class BaseCase;
@@ -303,7 +309,7 @@ struct MessageData
        MessageData (const MessageID& id_, GLenum severity_, const string& message_) : id(id_) , severity(severity_) , message(message_) {}
 };
 
-extern "C" typedef void GLW_APIENTRY DebugCallbackFunc(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, void*);
+extern "C" typedef void GLW_APIENTRY DebugCallbackFunc(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, const void*);
 
 // Base class
 class BaseCase : public NegativeTestShared::ErrorCase
@@ -320,7 +326,8 @@ public:
        virtual void                            expectError                     (GLenum error0, GLenum error1);
 
 protected:
-       struct VerificationResult {
+       struct VerificationResult
+       {
                const qpTestResult      result;
                const string            resultMessage;
                const string            logMessage;
@@ -348,9 +355,9 @@ protected:
        tcu::ResultCollector            m_results;
 };
 
-void BaseCase::callbackHandle (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, void* userParam)
+void BaseCase::callbackHandle (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, const void* userParam)
 {
-       static_cast<BaseCase*>(userParam)->callback(source, type, id, severity, string(message, &message[length]));
+       static_cast<BaseCase*>(const_cast<void*>(userParam))->callback(source, type, id, severity, string(message, &message[length]));
 }
 
 BaseCase::BaseCase (Context& ctx, const char* name, const char* desc)
@@ -2796,7 +2803,7 @@ GroupStackDepthQueryCase::IterateResult GroupStackDepthQueryCase::iterate (void)
        return STOP;
 }
 
-extern "C" void GLW_APIENTRY dummyCallback(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, void*)
+extern "C" void GLW_APIENTRY dummyCallback(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, const void*)
 {
        // dummy
 }
@@ -2945,6 +2952,7 @@ void DebugTests::init (void)
        const vector<FunctionContainer> fragmentFuncs                    = wrapCoreFunctions(NegativeTestShared::getNegativeFragmentApiTestFunctions());
        const vector<FunctionContainer> vaFuncs                                  = wrapCoreFunctions(NegativeTestShared::getNegativeVertexArrayApiTestFunctions());
        const vector<FunctionContainer> stateFuncs                               = wrapCoreFunctions(NegativeTestShared::getNegativeStateApiTestFunctions());
+       const vector<FunctionContainer> tessellationFuncs                = wrapCoreFunctions(NegativeTestShared::getNegativeTessellationTestFunctions());
        const vector<FunctionContainer> atomicCounterFuncs               = wrapCoreFunctions(NegativeTestShared::getNegativeAtomicCounterTestFunctions());
        const vector<FunctionContainer> imageLoadFuncs                   = wrapCoreFunctions(NegativeTestShared::getNegativeShaderImageLoadTestFunctions());
        const vector<FunctionContainer> imageStoreFuncs                  = wrapCoreFunctions(NegativeTestShared::getNegativeShaderImageStoreTestFunctions());
@@ -2952,8 +2960,13 @@ void DebugTests::init (void)
        const vector<FunctionContainer> imageAtomicExchangeFuncs = wrapCoreFunctions(NegativeTestShared::getNegativeShaderImageAtomicExchangeTestFunctions());
        const vector<FunctionContainer> shaderFunctionFuncs              = wrapCoreFunctions(NegativeTestShared::getNegativeShaderFunctionTestFunctions());
        const vector<FunctionContainer> shaderDirectiveFuncs     = wrapCoreFunctions(NegativeTestShared::getNegativeShaderDirectiveTestFunctions());
+       const vector<FunctionContainer> ssboBlockFuncs                   = wrapCoreFunctions(NegativeTestShared::getNegativeSSBOBlockTestFunctions());
        const vector<FunctionContainer> preciseFuncs                     = wrapCoreFunctions(NegativeTestShared::getNegativePreciseTestFunctions());
        const vector<FunctionContainer> advancedBlendFuncs               = wrapCoreFunctions(NegativeTestShared::getNegativeAdvancedBlendEquationTestFunctions());
+       const vector<FunctionContainer> shaderStorageFuncs               = wrapCoreFunctions(NegativeTestShared::getNegativeShaderStorageTestFunctions());
+       const vector<FunctionContainer> sampleVariablesFuncs     = wrapCoreFunctions(NegativeTestShared::getNegativeSampleVariablesTestFunctions());
+       const vector<FunctionContainer> computeFuncs                     = wrapCoreFunctions(NegativeTestShared::getNegativeComputeTestFunctions());
+       const vector<FunctionContainer> framebufferFetchFuncs    = wrapCoreFunctions(NegativeTestShared::getNegativeShaderFramebufferFetchTestFunctions());
        const vector<FunctionContainer> externalFuncs                    = getUserMessageFuncs();
 
        {
@@ -3057,8 +3070,14 @@ void DebugTests::init (void)
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "shader_image_exchange",          "Negative Shader Image Atomic Exchange API Cases",      imageAtomicExchangeFuncs));
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "shader_function",                        "Negative Shader Function Cases",                                       shaderFunctionFuncs));
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "shader_directive",                       "Negative Shader Directive Cases",                                      shaderDirectiveFuncs));
+                       host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "ssbo_block",                                     "Negative SSBO Block Cases",                                            ssboBlockFuncs));
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "precise",                                        "Negative Precise Cases",                                                       preciseFuncs));
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "advanced_blend",                         "Negative Advanced Blend Equation Cases",                       advancedBlendFuncs));
+                       host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "shader_storage",                         "Negative Shader Storage Cases",                                        shaderStorageFuncs));
+                       host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "tessellation",                           "Negative Tessellation Cases",                                          tessellationFuncs));
+                       host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "oes_sample_variables",           "Negative Sample Variables Cases",                                      sampleVariablesFuncs));
+                       host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "compute",                                        "Negative Compute Cases",                                                       computeFuncs));
+                       host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "framebuffer_fetch",                      "Negative Framebuffer Fetch Cases",                                     framebufferFetchFuncs));
                }
 
                {
@@ -3079,8 +3098,14 @@ void DebugTests::init (void)
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "shader_image_exchange",       "Negative Shader Image Atomic Exchange API Cases",      imageAtomicExchangeFuncs));
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "shader_function",                     "Negative Shader Function Cases",                                       shaderFunctionFuncs));
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "shader_directive",            "Negative Shader Directive Cases",                                      shaderDirectiveFuncs));
+                       host->addChild(createChildCases(CASETYPE_LOG, m_context, "ssbo_block",                          "Negative SSBO Block Cases",                                            ssboBlockFuncs));
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "precise",                                     "Negative Precise Cases",                                                       preciseFuncs));
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "advanced_blend",                      "Negative Advanced Blend Equation Cases",                       advancedBlendFuncs));
+                       host->addChild(createChildCases(CASETYPE_LOG, m_context, "shader_storage",                      "Negative Shader Storage Cases",                                        shaderStorageFuncs));
+                       host->addChild(createChildCases(CASETYPE_LOG, m_context, "tessellation",                        "Negative Tessellation Cases",                                          tessellationFuncs));
+                       host->addChild(createChildCases(CASETYPE_LOG, m_context, "oes_sample_variables",        "Negative Sample Variables Cases",                                      sampleVariablesFuncs));
+                       host->addChild(createChildCases(CASETYPE_LOG, m_context, "compute",                                     "Negative Compute Cases",                                                       computeFuncs));
+                       host->addChild(createChildCases(CASETYPE_LOG, m_context, "framebuffer_fetch",           "Negative Framebuffer Fetch Cases",                                     framebufferFetchFuncs));
                }
 
                {
@@ -3101,8 +3126,14 @@ void DebugTests::init (void)
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "shader_image_exchange",          "Negative Shader Image Atomic Exchange API Cases",      imageAtomicExchangeFuncs));
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "shader_function",                        "Negative Shader Function Cases",                                       shaderFunctionFuncs));
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "shader_directive",                       "Negative Shader Directive Cases",                                      shaderDirectiveFuncs));
+                       host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "ssbo_block",                                     "Negative SSBO Block Cases",                                            ssboBlockFuncs));
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "precise",                                        "Negative Precise Cases",                                                       preciseFuncs));
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "advanced_blend",                         "Negative Advanced Blend Equation Cases",                       advancedBlendFuncs));
+                       host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "shader_storage",                         "Negative Shader Storage Cases",                                        shaderStorageFuncs));
+                       host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "tessellation",                           "Negative Tessellation Cases",                                          tessellationFuncs));
+                       host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "oes_sample_variables",           "Negative Sample Variables Cases",                                      sampleVariablesFuncs));
+                       host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "compute",                                        "Negative Compute Cases",                                                       computeFuncs));
+                       host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "framebuffer_fetch",                      "Negative Framebuffer Fetch Cases",                                     framebufferFetchFuncs));
                }
        }