1 #ifndef _GLCPOLYGONOFFSETCLAMPTESTS_HPP
2 #define _GLCPOLYGONOFFSETCLAMPTESTS_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 glcPolygonOffsetClampTests.hpp
23 * \brief Conformance tests for the EXT_polygon_offset_clamp functionality.
24 */ /*-------------------------------------------------------------------*/
26 #include "esextcTestCaseBase.hpp"
27 #include "glcTestCase.hpp"
28 #include "gluShaderProgram.hpp"
37 struct PolygonOffsetClampValues
43 PolygonOffsetClampValues(GLfloat _f, GLfloat _u, GLfloat _c) : factor(_f), units(_u), clamp(_c)
50 class PolygonOffsetClampTestCaseBase : public deqp::TestCase
54 PolygonOffsetClampTestCaseBase(deqp::Context& context, const char* name, const char* description);
56 virtual tcu::TestNode::IterateResult iterate();
59 /* Protected methods */
60 virtual void test(const glw::Functions& gl) = DE_NULL;
62 /* Protected members */
63 bool m_extensionSupported;
66 /** Test verifies if polygon offset clamp works as expected for non-zero, finite clamp values
68 class PolygonOffsetClampAvailabilityTestCase : public PolygonOffsetClampTestCaseBase
72 PolygonOffsetClampAvailabilityTestCase(deqp::Context& context);
75 /* Protected methods */
76 void test(const glw::Functions& gl);
79 /** Base class for polygon offset clamp depth values verifying
81 class PolygonOffsetClampValueTestCaseBase : public PolygonOffsetClampTestCaseBase
85 PolygonOffsetClampValueTestCaseBase(deqp::Context& context, const char* name, const char* description);
88 virtual void deinit();
91 /* Protected members */
96 GLuint m_colorBufReadback;
98 std::vector<PolygonOffsetClampValues> m_testValues;
100 /* Protected methods */
101 void test(const glw::Functions& gl);
103 float readDepthValue(const glw::Functions& gl, const GLuint readDepthProgramId);
105 virtual bool verify(uint32_t caseNo, GLfloat depth, GLfloat offsetDepth, GLfloat offsetClampDepth) = DE_NULL;
108 /** Test verifies if polygon offset clamp works as expected for zero and infinite clamp values
110 class PolygonOffsetClampMinMaxTestCase : public PolygonOffsetClampValueTestCaseBase
114 PolygonOffsetClampMinMaxTestCase(deqp::Context& context);
119 /* Protected methods */
120 bool verify(uint32_t caseNo, GLfloat depth, GLfloat offsetDepth, GLfloat offsetClampDepth);
123 /** Test verifies ...
125 class PolygonOffsetClampZeroInfinityTestCase : public PolygonOffsetClampValueTestCaseBase
129 PolygonOffsetClampZeroInfinityTestCase(deqp::Context& context);
134 /* Protected methods */
135 bool verify(uint32_t caseNo, GLfloat depth, GLfloat offsetDepth, GLfloat offsetClampDepth);
138 /** Test group which encapsulates all ARB_shader_group_vote conformance tests */
139 class PolygonOffsetClamp : public deqp::TestCaseGroup
143 PolygonOffsetClamp(deqp::Context& context);
148 PolygonOffsetClamp(const PolygonOffsetClamp& other);
151 } /* glcts namespace */
153 #endif // _GLCPOLYGONOFFSETCLAMPTESTS_HPP