1 #ifndef _GLCSHADERGROUPVOTETESTS_HPP
2 #define _GLCSHADERGROUPVOTETESTS_HPP
3 /*-------------------------------------------------------------------------
4 * OpenGL Conformance Test Suite
5 * -----------------------------
7 * Copyright (c) 2017 The Khronos Group Inc.
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
22 * \file glcShaderGroupVoteTests.hpp
23 * \brief Conformance tests for the ARB_shader_group_vote functionality.
24 */ /*-------------------------------------------------------------------*/
26 #include "esextcTestCaseBase.hpp"
27 #include "glcTestCase.hpp"
28 #include "gluShaderProgram.hpp"
34 class ShaderGroupVoteTestCaseBase : public glcts::TestCaseBase
43 glu::ShaderProgram* m_program;
44 tcu::IVec4 m_desiredColor;
48 bool validateScreenPixels(deqp::Context& context, tcu::IVec4 desiredColor);
52 ComputeShader(const std::string& name, const std::string& shader);
53 ComputeShader(const std::string& name, const std::string& shader, const tcu::IVec4& desiredColor);
56 void create(deqp::Context& context);
57 void execute(deqp::Context& context);
58 void validate(deqp::Context& context);
62 ShaderGroupVoteTestCaseBase(deqp::Context& context, ExtParameters& extParam, const char* name,
63 const char* description);
68 tcu::TestNode::IterateResult iterate();
70 typedef std::vector<ComputeShader*>::iterator ComputeShaderIter;
73 /* Protected members */
74 bool m_extensionSupported;
75 std::vector<ComputeShader*> m_shaders;
78 /** Test verifies availability of new built-in functions and constants
80 class ShaderGroupVoteAvailabilityTestCase : public ShaderGroupVoteTestCaseBase
84 ShaderGroupVoteAvailabilityTestCase(deqp::Context& context, ExtParameters& extParam);
87 class ShaderGroupVoteFunctionTestCaseBase : public ShaderGroupVoteTestCaseBase
90 /* Protected members*/
91 std::string m_shaderBase;
95 ShaderGroupVoteFunctionTestCaseBase(deqp::Context& context, ExtParameters& extParam, const char* name,
96 const char* description);
99 /** Test verifies allInvocationsARB function calls
101 class ShaderGroupVoteAllInvocationsTestCase : public ShaderGroupVoteFunctionTestCaseBase
105 ShaderGroupVoteAllInvocationsTestCase(deqp::Context& context, ExtParameters& extParam);
108 /** Test verifies anyInvocationARB function calls
110 class ShaderGroupVoteAnyInvocationTestCase : public ShaderGroupVoteFunctionTestCaseBase
114 ShaderGroupVoteAnyInvocationTestCase(deqp::Context& context, ExtParameters& extParam);
117 /** Test verifies allInvocationsEqualARB function calls
119 class ShaderGroupVoteAllInvocationsEqualTestCase : public ShaderGroupVoteFunctionTestCaseBase
123 ShaderGroupVoteAllInvocationsEqualTestCase(deqp::Context& context, ExtParameters& extParam);
126 /** Test group which encapsulates all ARB_shader_group_vote conformance tests */
127 class ShaderGroupVote : public deqp::TestCaseGroup
131 ShaderGroupVote(deqp::Context& context);
136 ShaderGroupVote(const ShaderGroupVote& other);
139 } /* glcts namespace */
141 #endif // _GLCSHADERGROUPVOTETESTS_HPP