• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _GLCBLENDEQUATIONADVANCEDTESTS_HPP
2 #define _GLCBLENDEQUATIONADVANCEDTESTS_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2014-2016 The Khronos Group Inc.
8  *
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
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  */ /*!
22  * \file
23  * \brief
24  */ /*-------------------------------------------------------------------*/
25 
26 #include "glcTestCase.hpp"
27 #include "gluShaderUtil.hpp"
28 #include "tcuDefs.hpp"
29 
30 /*
31  New Tests
32 
33  Blending mode tests
34 
35  * For each new blending mode, render a simple test image where two constant
36  color primites overlap and are blended together. Use ReadPixels to obtain
37  a sample pixel from the overlap area and compare it to an expected result.
38  - Each blending mode is tested with multiple preselected color
39  combinations. The color combinations should be selected for each
40  blending equation so that they exercise all equivalance classes and
41  boundary values.
42  - Expected results are calculated at run-time using the blending equation
43  definitions.
44  - Comparison needs to use a tolerance that takes the possible precision
45  differences into account.
46  - Each blending mode needs to be tested with fragment shaders that use
47  1. blend_support_[mode] and 2. blend_support_all layout qualifiers.
48 
49 
50  Coherent blending tests
51 
52  * These tests are otherwise similar to "Blending mode tests" but instead of rendering
53  2 overlapping primitives, render N primitives using different blending modes
54  - If XXX_blend_equation_advanced_coherent is supported, enable
55  BLEND_ADVANCED_COHERENT_XXX setting before running the tests. If it is
56  not supported, execute BlendBarrierXXX after rendering each primitive.
57  - Each blending mode needs to be tested with a fragment shaders that uses
58  blend_support_all layout qualifier and a fragment shader that
59  lists all the used blending modes explicitly.
60 
61 
62  Other tests
63 
64  * If XXX_blend_equation_advanced_coherent is supported, test
65  BLEND_ADVANCED_COHERENT_XXX setting:
66  - The setting should work with Enable, Disable and IsEnable without producing errors
67  - Default value should be TRUE
68 
69  * Test that rendering into more than one color buffers at once produces
70  INVALID_OPERATION error when calling drawArrays/drawElements
71 
72  * Each blending mode needs to be tested without specifying the proper
73  blend_support_[mode] or blend_support_all layout qualifier in the
74  fragment shader. Expect INVALID_OPERATION GL error after calling
75  DrawElements/Arrays.
76 
77  * Test that the new blending modes cannot be used with
78  BlendEquationSeparate(i). Expect INVALID_ENUM GL error.
79 
80  * Test different behaviors for GLSL #extension
81  GL_XXX_blend_equation_advanced
82 
83  * Check that GLSL GL_XXX_blend_equation_advanced #define exists and is 1
84  */
85 
86 namespace glcts
87 {
88 
89 class BlendEquationAdvancedTests : public deqp::TestCaseGroup
90 {
91 public:
92 	BlendEquationAdvancedTests(deqp::Context& context, glu::GLSLVersion glslVersion);
93 	~BlendEquationAdvancedTests();
94 
95 	void init(void);
96 
97 private:
98 	glu::GLSLVersion m_glslVersion;
99 };
100 
101 } // glcts
102 
103 #endif // _GLCBLENDEQUATIONADVANCEDTESTS_HPP
104