xref: /aosp_15_r20/external/deqp/modules/gles3/functional/es3fOcclusionQueryTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program OpenGL ES 3.0 Module
3*35238bceSAndroid Build Coastguard Worker  * -------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker  *
5*35238bceSAndroid Build Coastguard Worker  * Copyright 2014 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker  *
7*35238bceSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker  *
11*35238bceSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker  *
13*35238bceSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker  * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker  *
19*35238bceSAndroid Build Coastguard Worker  *//*!
20*35238bceSAndroid Build Coastguard Worker  * \file
21*35238bceSAndroid Build Coastguard Worker  * \brief Occlusion query tests.
22*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker 
24*35238bceSAndroid Build Coastguard Worker #include "es3fOcclusionQueryTests.hpp"
25*35238bceSAndroid Build Coastguard Worker 
26*35238bceSAndroid Build Coastguard Worker #include "tcuTestLog.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "tcuVector.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "tcuSurface.hpp"
29*35238bceSAndroid Build Coastguard Worker #include "tcuRenderTarget.hpp"
30*35238bceSAndroid Build Coastguard Worker #include "gluShaderProgram.hpp"
31*35238bceSAndroid Build Coastguard Worker #include "gluPixelTransfer.hpp"
32*35238bceSAndroid Build Coastguard Worker #include "deRandom.hpp"
33*35238bceSAndroid Build Coastguard Worker #include "deString.h"
34*35238bceSAndroid Build Coastguard Worker 
35*35238bceSAndroid Build Coastguard Worker #include "glw.h"
36*35238bceSAndroid Build Coastguard Worker 
37*35238bceSAndroid Build Coastguard Worker namespace deqp
38*35238bceSAndroid Build Coastguard Worker {
39*35238bceSAndroid Build Coastguard Worker namespace gles3
40*35238bceSAndroid Build Coastguard Worker {
41*35238bceSAndroid Build Coastguard Worker namespace Functional
42*35238bceSAndroid Build Coastguard Worker {
43*35238bceSAndroid Build Coastguard Worker 
44*35238bceSAndroid Build Coastguard Worker static const tcu::Vec4 DEPTH_WRITE_COLOR   = tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f);
45*35238bceSAndroid Build Coastguard Worker static const tcu::Vec4 DEPTH_CLEAR_COLOR   = tcu::Vec4(0.0f, 0.5f, 0.8f, 1.0f);
46*35238bceSAndroid Build Coastguard Worker static const tcu::Vec4 STENCIL_WRITE_COLOR = tcu::Vec4(0.0f, 1.0f, 0.0f, 1.0f);
47*35238bceSAndroid Build Coastguard Worker static const tcu::Vec4 STENCIL_CLEAR_COLOR = tcu::Vec4(0.0f, 0.8f, 0.5f, 1.0f);
48*35238bceSAndroid Build Coastguard Worker static const tcu::Vec4 TARGET_COLOR        = tcu::Vec4(1.0f, 0.0f, 0.0f, 1.0f);
49*35238bceSAndroid Build Coastguard Worker static const int ELEMENTS_PER_VERTEX       = 4;
50*35238bceSAndroid Build Coastguard Worker static const int NUM_CASE_ITERATIONS       = 10;
51*35238bceSAndroid Build Coastguard Worker 
52*35238bceSAndroid Build Coastguard Worker // Constants to tweak visible/invisible case probability balance.
53*35238bceSAndroid Build Coastguard Worker 
54*35238bceSAndroid Build Coastguard Worker static const int DEPTH_CLEAR_OFFSET   = 100;
55*35238bceSAndroid Build Coastguard Worker static const int STENCIL_CLEAR_OFFSET = 100;
56*35238bceSAndroid Build Coastguard Worker static const int SCISSOR_OFFSET       = 100;
57*35238bceSAndroid Build Coastguard Worker static const int SCISSOR_MINSIZE      = 250;
58*35238bceSAndroid Build Coastguard Worker 
59*35238bceSAndroid Build Coastguard Worker enum OccluderType
60*35238bceSAndroid Build Coastguard Worker {
61*35238bceSAndroid Build Coastguard Worker     OCCLUDER_SCISSOR       = (1 << 0),
62*35238bceSAndroid Build Coastguard Worker     OCCLUDER_DEPTH_WRITE   = (1 << 1),
63*35238bceSAndroid Build Coastguard Worker     OCCLUDER_DEPTH_CLEAR   = (1 << 2),
64*35238bceSAndroid Build Coastguard Worker     OCCLUDER_STENCIL_WRITE = (1 << 3),
65*35238bceSAndroid Build Coastguard Worker     OCCLUDER_STENCIL_CLEAR = (1 << 4)
66*35238bceSAndroid Build Coastguard Worker };
67*35238bceSAndroid Build Coastguard Worker 
68*35238bceSAndroid Build Coastguard Worker class OcclusionQueryCase : public TestCase
69*35238bceSAndroid Build Coastguard Worker {
70*35238bceSAndroid Build Coastguard Worker public:
71*35238bceSAndroid Build Coastguard Worker     OcclusionQueryCase(Context &context, const char *name, const char *description, int numOccluderDraws,
72*35238bceSAndroid Build Coastguard Worker                        int numOccludersPerDraw, float occluderSize, int numTargetDraws, int numTargetsPerDraw,
73*35238bceSAndroid Build Coastguard Worker                        float targetSize, uint32_t queryMode, uint32_t occluderTypes);
74*35238bceSAndroid Build Coastguard Worker     ~OcclusionQueryCase(void);
75*35238bceSAndroid Build Coastguard Worker 
76*35238bceSAndroid Build Coastguard Worker     void init(void);
77*35238bceSAndroid Build Coastguard Worker     void deinit(void);
78*35238bceSAndroid Build Coastguard Worker     IterateResult iterate(void);
79*35238bceSAndroid Build Coastguard Worker 
80*35238bceSAndroid Build Coastguard Worker private:
81*35238bceSAndroid Build Coastguard Worker     OcclusionQueryCase(const OcclusionQueryCase &other);
82*35238bceSAndroid Build Coastguard Worker     OcclusionQueryCase &operator=(const OcclusionQueryCase &other);
83*35238bceSAndroid Build Coastguard Worker 
84*35238bceSAndroid Build Coastguard Worker     int m_numOccluderDraws;
85*35238bceSAndroid Build Coastguard Worker     int m_numOccludersPerDraw;
86*35238bceSAndroid Build Coastguard Worker     float m_occluderSize;
87*35238bceSAndroid Build Coastguard Worker     int m_numTargetDraws;
88*35238bceSAndroid Build Coastguard Worker     int m_numTargetsPerDraw;
89*35238bceSAndroid Build Coastguard Worker     float m_targetSize;
90*35238bceSAndroid Build Coastguard Worker     uint32_t m_queryMode;
91*35238bceSAndroid Build Coastguard Worker     uint32_t m_occluderTypes;
92*35238bceSAndroid Build Coastguard Worker 
93*35238bceSAndroid Build Coastguard Worker     glu::RenderContext &m_renderCtx;
94*35238bceSAndroid Build Coastguard Worker     glu::ShaderProgram *m_program;
95*35238bceSAndroid Build Coastguard Worker     int m_iterNdx;
96*35238bceSAndroid Build Coastguard Worker     de::Random m_rnd;
97*35238bceSAndroid Build Coastguard Worker };
98*35238bceSAndroid Build Coastguard Worker 
OcclusionQueryCase(Context & context,const char * name,const char * description,int numOccluderDraws,int numOccludersPerDraw,float occluderSize,int numTargetDraws,int numTargetsPerDraw,float targetSize,uint32_t queryMode,uint32_t occluderTypes)99*35238bceSAndroid Build Coastguard Worker OcclusionQueryCase::OcclusionQueryCase(Context &context, const char *name, const char *description,
100*35238bceSAndroid Build Coastguard Worker                                        int numOccluderDraws, int numOccludersPerDraw, float occluderSize,
101*35238bceSAndroid Build Coastguard Worker                                        int numTargetDraws, int numTargetsPerDraw, float targetSize, uint32_t queryMode,
102*35238bceSAndroid Build Coastguard Worker                                        uint32_t occluderTypes)
103*35238bceSAndroid Build Coastguard Worker     : TestCase(context, name, description)
104*35238bceSAndroid Build Coastguard Worker     , m_numOccluderDraws(numOccluderDraws)
105*35238bceSAndroid Build Coastguard Worker     , m_numOccludersPerDraw(numOccludersPerDraw)
106*35238bceSAndroid Build Coastguard Worker     , m_occluderSize(occluderSize)
107*35238bceSAndroid Build Coastguard Worker     , m_numTargetDraws(numTargetDraws)
108*35238bceSAndroid Build Coastguard Worker     , m_numTargetsPerDraw(numTargetsPerDraw)
109*35238bceSAndroid Build Coastguard Worker     , m_targetSize(targetSize)
110*35238bceSAndroid Build Coastguard Worker     , m_queryMode(queryMode)
111*35238bceSAndroid Build Coastguard Worker     , m_occluderTypes(occluderTypes)
112*35238bceSAndroid Build Coastguard Worker     , m_renderCtx(context.getRenderContext())
113*35238bceSAndroid Build Coastguard Worker     , m_program(DE_NULL)
114*35238bceSAndroid Build Coastguard Worker     , m_iterNdx(0)
115*35238bceSAndroid Build Coastguard Worker     , m_rnd(deStringHash(name))
116*35238bceSAndroid Build Coastguard Worker {
117*35238bceSAndroid Build Coastguard Worker }
118*35238bceSAndroid Build Coastguard Worker 
~OcclusionQueryCase(void)119*35238bceSAndroid Build Coastguard Worker OcclusionQueryCase::~OcclusionQueryCase(void)
120*35238bceSAndroid Build Coastguard Worker {
121*35238bceSAndroid Build Coastguard Worker     OcclusionQueryCase::deinit();
122*35238bceSAndroid Build Coastguard Worker }
123*35238bceSAndroid Build Coastguard Worker 
generateVertices(std::vector<float> & dst,float width,float height,int primitiveCount,int verticesPerPrimitive,de::Random rnd,float primitiveSize,float minZ,float maxZ)124*35238bceSAndroid Build Coastguard Worker static void generateVertices(std::vector<float> &dst, float width, float height, int primitiveCount,
125*35238bceSAndroid Build Coastguard Worker                              int verticesPerPrimitive, de::Random rnd, float primitiveSize, float minZ, float maxZ)
126*35238bceSAndroid Build Coastguard Worker {
127*35238bceSAndroid Build Coastguard Worker     float w = width / 2.0f;
128*35238bceSAndroid Build Coastguard Worker     float h = height / 2.0f;
129*35238bceSAndroid Build Coastguard Worker     float s = primitiveSize / 2.0f;
130*35238bceSAndroid Build Coastguard Worker 
131*35238bceSAndroid Build Coastguard Worker     int vertexCount = verticesPerPrimitive * primitiveCount;
132*35238bceSAndroid Build Coastguard Worker     dst.resize(vertexCount * ELEMENTS_PER_VERTEX);
133*35238bceSAndroid Build Coastguard Worker 
134*35238bceSAndroid Build Coastguard Worker     for (int i = 0; i < vertexCount; i += 3) // First loop gets a random point inside unit square
135*35238bceSAndroid Build Coastguard Worker     {
136*35238bceSAndroid Build Coastguard Worker         float rndX = rnd.getFloat(-w, w);
137*35238bceSAndroid Build Coastguard Worker         float rndY = rnd.getFloat(-h, h);
138*35238bceSAndroid Build Coastguard Worker 
139*35238bceSAndroid Build Coastguard Worker         for (int j = 0; j < verticesPerPrimitive;
140*35238bceSAndroid Build Coastguard Worker              j++) // Second loop gets 3 random points within given distance s from (rndX, rndY)
141*35238bceSAndroid Build Coastguard Worker         {
142*35238bceSAndroid Build Coastguard Worker             dst[(i + j) * ELEMENTS_PER_VERTEX]     = rndX + rnd.getFloat(-s, s); // x
143*35238bceSAndroid Build Coastguard Worker             dst[(i + j) * ELEMENTS_PER_VERTEX + 1] = rndY + rnd.getFloat(-s, s); // y
144*35238bceSAndroid Build Coastguard Worker             dst[(i + j) * ELEMENTS_PER_VERTEX + 2] = rnd.getFloat(minZ, maxZ);   // z
145*35238bceSAndroid Build Coastguard Worker             dst[(i + j) * ELEMENTS_PER_VERTEX + 3] = 1.0f;                       // w
146*35238bceSAndroid Build Coastguard Worker         }
147*35238bceSAndroid Build Coastguard Worker     }
148*35238bceSAndroid Build Coastguard Worker }
149*35238bceSAndroid Build Coastguard Worker 
init(void)150*35238bceSAndroid Build Coastguard Worker void OcclusionQueryCase::init(void)
151*35238bceSAndroid Build Coastguard Worker {
152*35238bceSAndroid Build Coastguard Worker     const char *vertShaderSource = "#version 300 es\n"
153*35238bceSAndroid Build Coastguard Worker                                    "layout(location = 0) in mediump vec4 a_position;\n"
154*35238bceSAndroid Build Coastguard Worker                                    "\n"
155*35238bceSAndroid Build Coastguard Worker                                    "void main (void)\n"
156*35238bceSAndroid Build Coastguard Worker                                    "{\n"
157*35238bceSAndroid Build Coastguard Worker                                    "    gl_Position = a_position;\n"
158*35238bceSAndroid Build Coastguard Worker                                    "}\n";
159*35238bceSAndroid Build Coastguard Worker 
160*35238bceSAndroid Build Coastguard Worker     const char *fragShaderSource = "#version 300 es\n"
161*35238bceSAndroid Build Coastguard Worker                                    "layout(location = 0) out mediump vec4 dEQP_FragColor;\n"
162*35238bceSAndroid Build Coastguard Worker                                    "uniform mediump vec4 u_color;\n"
163*35238bceSAndroid Build Coastguard Worker                                    "\n"
164*35238bceSAndroid Build Coastguard Worker                                    "void main (void)\n"
165*35238bceSAndroid Build Coastguard Worker                                    "{\n"
166*35238bceSAndroid Build Coastguard Worker                                    "    mediump float depth_gradient = max(gl_FragCoord.z, 0.0);\n"
167*35238bceSAndroid Build Coastguard Worker                                    "    mediump float bias = 0.1;\n"
168*35238bceSAndroid Build Coastguard Worker                                    "    dEQP_FragColor = vec4(u_color.xyz * (depth_gradient + bias), 1.0);\n"
169*35238bceSAndroid Build Coastguard Worker                                    "}\n";
170*35238bceSAndroid Build Coastguard Worker 
171*35238bceSAndroid Build Coastguard Worker     DE_ASSERT(!m_program);
172*35238bceSAndroid Build Coastguard Worker     m_program = new glu::ShaderProgram(m_context.getRenderContext(),
173*35238bceSAndroid Build Coastguard Worker                                        glu::makeVtxFragSources(vertShaderSource, fragShaderSource));
174*35238bceSAndroid Build Coastguard Worker 
175*35238bceSAndroid Build Coastguard Worker     if (!m_program->isOk())
176*35238bceSAndroid Build Coastguard Worker     {
177*35238bceSAndroid Build Coastguard Worker         m_testCtx.getLog() << *m_program;
178*35238bceSAndroid Build Coastguard Worker         delete m_program;
179*35238bceSAndroid Build Coastguard Worker         m_program = DE_NULL;
180*35238bceSAndroid Build Coastguard Worker         TCU_FAIL("Failed to compile shader program");
181*35238bceSAndroid Build Coastguard Worker     }
182*35238bceSAndroid Build Coastguard Worker 
183*35238bceSAndroid Build Coastguard Worker     m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass"); // Initialize test result to pass.
184*35238bceSAndroid Build Coastguard Worker     GLU_CHECK_MSG("Case initialization finished");
185*35238bceSAndroid Build Coastguard Worker }
186*35238bceSAndroid Build Coastguard Worker 
deinit(void)187*35238bceSAndroid Build Coastguard Worker void OcclusionQueryCase::deinit(void)
188*35238bceSAndroid Build Coastguard Worker {
189*35238bceSAndroid Build Coastguard Worker     delete m_program;
190*35238bceSAndroid Build Coastguard Worker     m_program = DE_NULL;
191*35238bceSAndroid Build Coastguard Worker }
192*35238bceSAndroid Build Coastguard Worker 
iterate(void)193*35238bceSAndroid Build Coastguard Worker OcclusionQueryCase::IterateResult OcclusionQueryCase::iterate(void)
194*35238bceSAndroid Build Coastguard Worker {
195*35238bceSAndroid Build Coastguard Worker     tcu::TestLog &log                     = m_testCtx.getLog();
196*35238bceSAndroid Build Coastguard Worker     const tcu::RenderTarget &renderTarget = m_context.getRenderTarget();
197*35238bceSAndroid Build Coastguard Worker     uint32_t colorUnif                    = glGetUniformLocation(m_program->getProgram(), "u_color");
198*35238bceSAndroid Build Coastguard Worker 
199*35238bceSAndroid Build Coastguard Worker     std::vector<float> occluderVertices;
200*35238bceSAndroid Build Coastguard Worker     std::vector<float> targetVertices;
201*35238bceSAndroid Build Coastguard Worker     std::vector<uint32_t> queryIds(1, 0);
202*35238bceSAndroid Build Coastguard Worker     bool queryResult     = false;
203*35238bceSAndroid Build Coastguard Worker     bool colorReadResult = false;
204*35238bceSAndroid Build Coastguard Worker     int targetW          = renderTarget.getWidth();
205*35238bceSAndroid Build Coastguard Worker     int targetH          = renderTarget.getHeight();
206*35238bceSAndroid Build Coastguard Worker 
207*35238bceSAndroid Build Coastguard Worker     log << tcu::TestLog::Message << "Case iteration " << m_iterNdx + 1 << " / " << NUM_CASE_ITERATIONS
208*35238bceSAndroid Build Coastguard Worker         << tcu::TestLog::EndMessage;
209*35238bceSAndroid Build Coastguard Worker     log << tcu::TestLog::Message << "Parameters:\n"
210*35238bceSAndroid Build Coastguard Worker         << "- " << m_numOccluderDraws << " occluder draws, " << m_numOccludersPerDraw << " primitive writes per draw,\n"
211*35238bceSAndroid Build Coastguard Worker         << "- " << m_numTargetDraws << " target draws, " << m_numTargetsPerDraw << " targets per draw\n"
212*35238bceSAndroid Build Coastguard Worker         << tcu::TestLog::EndMessage;
213*35238bceSAndroid Build Coastguard Worker 
214*35238bceSAndroid Build Coastguard Worker     DE_ASSERT(m_program);
215*35238bceSAndroid Build Coastguard Worker 
216*35238bceSAndroid Build Coastguard Worker     glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
217*35238bceSAndroid Build Coastguard Worker     glClearDepthf(1.0f);
218*35238bceSAndroid Build Coastguard Worker     glClearStencil(0);
219*35238bceSAndroid Build Coastguard Worker     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
220*35238bceSAndroid Build Coastguard Worker     glUseProgram(m_program->getProgram());
221*35238bceSAndroid Build Coastguard Worker     glEnableVertexAttribArray(0);
222*35238bceSAndroid Build Coastguard Worker 
223*35238bceSAndroid Build Coastguard Worker     // Draw occluders
224*35238bceSAndroid Build Coastguard Worker 
225*35238bceSAndroid Build Coastguard Worker     std::vector<OccluderType> occOptions(0);
226*35238bceSAndroid Build Coastguard Worker     if (m_occluderTypes & OCCLUDER_DEPTH_WRITE)
227*35238bceSAndroid Build Coastguard Worker         occOptions.push_back(OCCLUDER_DEPTH_WRITE);
228*35238bceSAndroid Build Coastguard Worker     if (m_occluderTypes & OCCLUDER_DEPTH_CLEAR)
229*35238bceSAndroid Build Coastguard Worker         occOptions.push_back(OCCLUDER_DEPTH_CLEAR);
230*35238bceSAndroid Build Coastguard Worker     if (m_occluderTypes & OCCLUDER_STENCIL_WRITE)
231*35238bceSAndroid Build Coastguard Worker         occOptions.push_back(OCCLUDER_STENCIL_WRITE);
232*35238bceSAndroid Build Coastguard Worker     if (m_occluderTypes & OCCLUDER_STENCIL_CLEAR)
233*35238bceSAndroid Build Coastguard Worker         occOptions.push_back(OCCLUDER_STENCIL_CLEAR);
234*35238bceSAndroid Build Coastguard Worker 
235*35238bceSAndroid Build Coastguard Worker     for (int i = 0; i < m_numOccluderDraws; i++)
236*35238bceSAndroid Build Coastguard Worker     {
237*35238bceSAndroid Build Coastguard Worker         if (occOptions.empty())
238*35238bceSAndroid Build Coastguard Worker             break;
239*35238bceSAndroid Build Coastguard Worker 
240*35238bceSAndroid Build Coastguard Worker         OccluderType type = occOptions[m_rnd.getInt(
241*35238bceSAndroid Build Coastguard Worker             0, (int)occOptions.size() - 1)]; // Choosing a random occluder type from available options
242*35238bceSAndroid Build Coastguard Worker 
243*35238bceSAndroid Build Coastguard Worker         switch (type)
244*35238bceSAndroid Build Coastguard Worker         {
245*35238bceSAndroid Build Coastguard Worker         case OCCLUDER_DEPTH_WRITE:
246*35238bceSAndroid Build Coastguard Worker             log << tcu::TestLog::Message << "Occluder draw " << i + 1 << " / " << m_numOccluderDraws << " : "
247*35238bceSAndroid Build Coastguard Worker                 << "Depth write" << tcu::TestLog::EndMessage;
248*35238bceSAndroid Build Coastguard Worker 
249*35238bceSAndroid Build Coastguard Worker             generateVertices(occluderVertices, 2.0f, 2.0f, m_numOccludersPerDraw, 3, m_rnd, m_occluderSize, 0.0f,
250*35238bceSAndroid Build Coastguard Worker                              0.6f); // Generate vertices for occluding primitives
251*35238bceSAndroid Build Coastguard Worker 
252*35238bceSAndroid Build Coastguard Worker             DE_ASSERT(!occluderVertices.empty());
253*35238bceSAndroid Build Coastguard Worker 
254*35238bceSAndroid Build Coastguard Worker             glEnable(GL_DEPTH_TEST);
255*35238bceSAndroid Build Coastguard Worker             glUniform4f(colorUnif, DEPTH_WRITE_COLOR.x(), DEPTH_WRITE_COLOR.y(), DEPTH_WRITE_COLOR.z(),
256*35238bceSAndroid Build Coastguard Worker                         DEPTH_WRITE_COLOR.w());
257*35238bceSAndroid Build Coastguard Worker             glVertexAttribPointer(0, ELEMENTS_PER_VERTEX, GL_FLOAT, GL_FALSE, 0, &occluderVertices[0]);
258*35238bceSAndroid Build Coastguard Worker             glDrawArrays(GL_TRIANGLES, 0, 3 * m_numOccludersPerDraw);
259*35238bceSAndroid Build Coastguard Worker             glDisable(GL_DEPTH_TEST);
260*35238bceSAndroid Build Coastguard Worker 
261*35238bceSAndroid Build Coastguard Worker             break;
262*35238bceSAndroid Build Coastguard Worker 
263*35238bceSAndroid Build Coastguard Worker         case OCCLUDER_DEPTH_CLEAR:
264*35238bceSAndroid Build Coastguard Worker         {
265*35238bceSAndroid Build Coastguard Worker             int scissorBoxX = m_rnd.getInt(-DEPTH_CLEAR_OFFSET, targetW);
266*35238bceSAndroid Build Coastguard Worker             int scissorBoxY = m_rnd.getInt(-DEPTH_CLEAR_OFFSET, targetH);
267*35238bceSAndroid Build Coastguard Worker             int scissorBoxW = m_rnd.getInt(DEPTH_CLEAR_OFFSET, targetW + DEPTH_CLEAR_OFFSET);
268*35238bceSAndroid Build Coastguard Worker             int scissorBoxH = m_rnd.getInt(DEPTH_CLEAR_OFFSET, targetH + DEPTH_CLEAR_OFFSET);
269*35238bceSAndroid Build Coastguard Worker 
270*35238bceSAndroid Build Coastguard Worker             log << tcu::TestLog::Message << "Occluder draw " << i + 1 << " / " << m_numOccluderDraws << " : "
271*35238bceSAndroid Build Coastguard Worker                 << "Depth clear" << tcu::TestLog::EndMessage;
272*35238bceSAndroid Build Coastguard Worker             log << tcu::TestLog::Message << "Depth-clearing box drawn at "
273*35238bceSAndroid Build Coastguard Worker                 << "(" << scissorBoxX << ", " << scissorBoxY << ")"
274*35238bceSAndroid Build Coastguard Worker                 << ", width = " << scissorBoxW << ", height = " << scissorBoxH << "." << tcu::TestLog::EndMessage;
275*35238bceSAndroid Build Coastguard Worker 
276*35238bceSAndroid Build Coastguard Worker             glEnable(GL_SCISSOR_TEST);
277*35238bceSAndroid Build Coastguard Worker             glScissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH);
278*35238bceSAndroid Build Coastguard Worker             glClearDepthf(0.0f);
279*35238bceSAndroid Build Coastguard Worker             glClearColor(DEPTH_CLEAR_COLOR.x(), DEPTH_CLEAR_COLOR.y(), DEPTH_CLEAR_COLOR.z(), DEPTH_CLEAR_COLOR.w());
280*35238bceSAndroid Build Coastguard Worker             glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
281*35238bceSAndroid Build Coastguard Worker             glDisable(GL_SCISSOR_TEST);
282*35238bceSAndroid Build Coastguard Worker 
283*35238bceSAndroid Build Coastguard Worker             break;
284*35238bceSAndroid Build Coastguard Worker         }
285*35238bceSAndroid Build Coastguard Worker 
286*35238bceSAndroid Build Coastguard Worker         case OCCLUDER_STENCIL_WRITE:
287*35238bceSAndroid Build Coastguard Worker             log << tcu::TestLog::Message << "Occluder draw " << i + 1 << " / " << m_numOccluderDraws << " : "
288*35238bceSAndroid Build Coastguard Worker                 << "Stencil write" << tcu::TestLog::EndMessage;
289*35238bceSAndroid Build Coastguard Worker 
290*35238bceSAndroid Build Coastguard Worker             generateVertices(occluderVertices, 2.0f, 2.0f, m_numOccludersPerDraw, 3, m_rnd, m_occluderSize, 0.0f, 0.6f);
291*35238bceSAndroid Build Coastguard Worker 
292*35238bceSAndroid Build Coastguard Worker             glStencilFunc(GL_ALWAYS, 1, 0xFF);
293*35238bceSAndroid Build Coastguard Worker             glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
294*35238bceSAndroid Build Coastguard Worker 
295*35238bceSAndroid Build Coastguard Worker             DE_ASSERT(!occluderVertices.empty());
296*35238bceSAndroid Build Coastguard Worker 
297*35238bceSAndroid Build Coastguard Worker             glEnable(GL_STENCIL_TEST);
298*35238bceSAndroid Build Coastguard Worker             glUniform4f(colorUnif, STENCIL_WRITE_COLOR.x(), STENCIL_WRITE_COLOR.y(), STENCIL_WRITE_COLOR.z(),
299*35238bceSAndroid Build Coastguard Worker                         STENCIL_WRITE_COLOR.w());
300*35238bceSAndroid Build Coastguard Worker             glVertexAttribPointer(0, ELEMENTS_PER_VERTEX, GL_FLOAT, GL_FALSE, 0, &occluderVertices[0]);
301*35238bceSAndroid Build Coastguard Worker             glDrawArrays(GL_TRIANGLES, 0, 3 * m_numOccludersPerDraw);
302*35238bceSAndroid Build Coastguard Worker             glDisable(GL_STENCIL_TEST);
303*35238bceSAndroid Build Coastguard Worker 
304*35238bceSAndroid Build Coastguard Worker             break;
305*35238bceSAndroid Build Coastguard Worker 
306*35238bceSAndroid Build Coastguard Worker         case OCCLUDER_STENCIL_CLEAR:
307*35238bceSAndroid Build Coastguard Worker         {
308*35238bceSAndroid Build Coastguard Worker             int scissorBoxX = m_rnd.getInt(-STENCIL_CLEAR_OFFSET, targetW);
309*35238bceSAndroid Build Coastguard Worker             int scissorBoxY = m_rnd.getInt(-STENCIL_CLEAR_OFFSET, targetH);
310*35238bceSAndroid Build Coastguard Worker             int scissorBoxW = m_rnd.getInt(STENCIL_CLEAR_OFFSET, targetW + STENCIL_CLEAR_OFFSET);
311*35238bceSAndroid Build Coastguard Worker             int scissorBoxH = m_rnd.getInt(STENCIL_CLEAR_OFFSET, targetH + STENCIL_CLEAR_OFFSET);
312*35238bceSAndroid Build Coastguard Worker 
313*35238bceSAndroid Build Coastguard Worker             log << tcu::TestLog::Message << "Occluder draw " << i + 1 << " / " << m_numOccluderDraws << " : "
314*35238bceSAndroid Build Coastguard Worker                 << "Stencil clear" << tcu::TestLog::EndMessage;
315*35238bceSAndroid Build Coastguard Worker             log << tcu::TestLog::Message << "Stencil-clearing box drawn at "
316*35238bceSAndroid Build Coastguard Worker                 << "(" << scissorBoxX << ", " << scissorBoxY << ")"
317*35238bceSAndroid Build Coastguard Worker                 << ", width = " << scissorBoxW << ", height = " << scissorBoxH << "." << tcu::TestLog::EndMessage;
318*35238bceSAndroid Build Coastguard Worker 
319*35238bceSAndroid Build Coastguard Worker             glEnable(GL_SCISSOR_TEST);
320*35238bceSAndroid Build Coastguard Worker             glScissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH);
321*35238bceSAndroid Build Coastguard Worker             glClearStencil(1);
322*35238bceSAndroid Build Coastguard Worker             glClearColor(STENCIL_CLEAR_COLOR.x(), STENCIL_CLEAR_COLOR.y(), STENCIL_CLEAR_COLOR.z(),
323*35238bceSAndroid Build Coastguard Worker                          STENCIL_CLEAR_COLOR.w());
324*35238bceSAndroid Build Coastguard Worker             glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
325*35238bceSAndroid Build Coastguard Worker             glDisable(GL_SCISSOR_TEST);
326*35238bceSAndroid Build Coastguard Worker 
327*35238bceSAndroid Build Coastguard Worker             break;
328*35238bceSAndroid Build Coastguard Worker         }
329*35238bceSAndroid Build Coastguard Worker 
330*35238bceSAndroid Build Coastguard Worker         default:
331*35238bceSAndroid Build Coastguard Worker             DE_ASSERT(false);
332*35238bceSAndroid Build Coastguard Worker             break;
333*35238bceSAndroid Build Coastguard Worker         }
334*35238bceSAndroid Build Coastguard Worker     }
335*35238bceSAndroid Build Coastguard Worker 
336*35238bceSAndroid Build Coastguard Worker     if (m_occluderTypes & OCCLUDER_SCISSOR)
337*35238bceSAndroid Build Coastguard Worker     {
338*35238bceSAndroid Build Coastguard Worker         int scissorBoxX = m_rnd.getInt(-SCISSOR_OFFSET, targetW - SCISSOR_OFFSET);
339*35238bceSAndroid Build Coastguard Worker         int scissorBoxY = m_rnd.getInt(-SCISSOR_OFFSET, targetH - SCISSOR_OFFSET);
340*35238bceSAndroid Build Coastguard Worker         int scissorBoxW = m_rnd.getInt(SCISSOR_MINSIZE, targetW + SCISSOR_OFFSET);
341*35238bceSAndroid Build Coastguard Worker         int scissorBoxH = m_rnd.getInt(SCISSOR_MINSIZE, targetH + SCISSOR_OFFSET);
342*35238bceSAndroid Build Coastguard Worker 
343*35238bceSAndroid Build Coastguard Worker         log << tcu::TestLog::Message << "Scissor box drawn at "
344*35238bceSAndroid Build Coastguard Worker             << "(" << scissorBoxX << ", " << scissorBoxY << ")"
345*35238bceSAndroid Build Coastguard Worker             << ", width = " << scissorBoxW << ", height = " << scissorBoxH << "." << tcu::TestLog::EndMessage;
346*35238bceSAndroid Build Coastguard Worker 
347*35238bceSAndroid Build Coastguard Worker         glEnable(GL_SCISSOR_TEST);
348*35238bceSAndroid Build Coastguard Worker         glScissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH);
349*35238bceSAndroid Build Coastguard Worker     }
350*35238bceSAndroid Build Coastguard Worker 
351*35238bceSAndroid Build Coastguard Worker     glGenQueries(1, &queryIds[0]);
352*35238bceSAndroid Build Coastguard Worker     glBeginQuery(m_queryMode, queryIds[0]);
353*35238bceSAndroid Build Coastguard Worker     GLU_CHECK_MSG("Occlusion query started");
354*35238bceSAndroid Build Coastguard Worker 
355*35238bceSAndroid Build Coastguard Worker     // Draw target primitives
356*35238bceSAndroid Build Coastguard Worker 
357*35238bceSAndroid Build Coastguard Worker     glEnable(GL_DEPTH_TEST);
358*35238bceSAndroid Build Coastguard Worker     glEnable(GL_STENCIL_TEST);
359*35238bceSAndroid Build Coastguard Worker     glStencilFunc(GL_EQUAL, 0, 0xFF);
360*35238bceSAndroid Build Coastguard Worker 
361*35238bceSAndroid Build Coastguard Worker     for (int i = 0; i < m_numTargetDraws; i++)
362*35238bceSAndroid Build Coastguard Worker     {
363*35238bceSAndroid Build Coastguard Worker         generateVertices(targetVertices, 2.0f, 2.0f, m_numTargetsPerDraw, 3, m_rnd, m_targetSize, 0.4f,
364*35238bceSAndroid Build Coastguard Worker                          1.0f); // Generate vertices for target primitives
365*35238bceSAndroid Build Coastguard Worker 
366*35238bceSAndroid Build Coastguard Worker         if (!targetVertices.empty())
367*35238bceSAndroid Build Coastguard Worker         {
368*35238bceSAndroid Build Coastguard Worker             glUniform4f(colorUnif, TARGET_COLOR.x(), TARGET_COLOR.y(), TARGET_COLOR.z(), TARGET_COLOR.w());
369*35238bceSAndroid Build Coastguard Worker             glVertexAttribPointer(0, ELEMENTS_PER_VERTEX, GL_FLOAT, GL_FALSE, 0, &targetVertices[0]);
370*35238bceSAndroid Build Coastguard Worker             glDrawArrays(GL_TRIANGLES, 0, 3 * m_numTargetsPerDraw);
371*35238bceSAndroid Build Coastguard Worker         }
372*35238bceSAndroid Build Coastguard Worker     }
373*35238bceSAndroid Build Coastguard Worker 
374*35238bceSAndroid Build Coastguard Worker     glEndQuery(m_queryMode);
375*35238bceSAndroid Build Coastguard Worker     glFinish();
376*35238bceSAndroid Build Coastguard Worker     glDisable(GL_SCISSOR_TEST);
377*35238bceSAndroid Build Coastguard Worker     glDisable(GL_STENCIL_TEST);
378*35238bceSAndroid Build Coastguard Worker     glDisable(GL_DEPTH_TEST);
379*35238bceSAndroid Build Coastguard Worker 
380*35238bceSAndroid Build Coastguard Worker     // Check that query result is available.
381*35238bceSAndroid Build Coastguard Worker     {
382*35238bceSAndroid Build Coastguard Worker         uint32_t resultAvailable = GL_FALSE;
383*35238bceSAndroid Build Coastguard Worker         glGetQueryObjectuiv(queryIds[0], GL_QUERY_RESULT_AVAILABLE, &resultAvailable);
384*35238bceSAndroid Build Coastguard Worker 
385*35238bceSAndroid Build Coastguard Worker         if (resultAvailable == GL_FALSE)
386*35238bceSAndroid Build Coastguard Worker             TCU_FAIL("Occlusion query failed to return a result after glFinish()");
387*35238bceSAndroid Build Coastguard Worker     }
388*35238bceSAndroid Build Coastguard Worker 
389*35238bceSAndroid Build Coastguard Worker     // Read query result.
390*35238bceSAndroid Build Coastguard Worker     {
391*35238bceSAndroid Build Coastguard Worker         uint32_t result = 0;
392*35238bceSAndroid Build Coastguard Worker         glGetQueryObjectuiv(queryIds[0], GL_QUERY_RESULT, &result);
393*35238bceSAndroid Build Coastguard Worker         queryResult = (result != GL_FALSE);
394*35238bceSAndroid Build Coastguard Worker     }
395*35238bceSAndroid Build Coastguard Worker 
396*35238bceSAndroid Build Coastguard Worker     glDeleteQueries(1, &queryIds[0]);
397*35238bceSAndroid Build Coastguard Worker     GLU_CHECK_MSG("Occlusion query finished");
398*35238bceSAndroid Build Coastguard Worker 
399*35238bceSAndroid Build Coastguard Worker     // Read pixel data
400*35238bceSAndroid Build Coastguard Worker 
401*35238bceSAndroid Build Coastguard Worker     tcu::Surface pixels(renderTarget.getWidth(), renderTarget.getHeight());
402*35238bceSAndroid Build Coastguard Worker     glu::readPixels(m_context.getRenderContext(), 0, 0, pixels.getAccess());
403*35238bceSAndroid Build Coastguard Worker 
404*35238bceSAndroid Build Coastguard Worker     {
405*35238bceSAndroid Build Coastguard Worker         int width  = pixels.getWidth();
406*35238bceSAndroid Build Coastguard Worker         int height = pixels.getHeight();
407*35238bceSAndroid Build Coastguard Worker 
408*35238bceSAndroid Build Coastguard Worker         for (int y = 0; y < height; y++)
409*35238bceSAndroid Build Coastguard Worker         {
410*35238bceSAndroid Build Coastguard Worker             for (int x = 0; x < width; x++)
411*35238bceSAndroid Build Coastguard Worker             {
412*35238bceSAndroid Build Coastguard Worker                 if (pixels.getPixel(x, y).getRed() != 0)
413*35238bceSAndroid Build Coastguard Worker                 {
414*35238bceSAndroid Build Coastguard Worker                     colorReadResult = true;
415*35238bceSAndroid Build Coastguard Worker                     break;
416*35238bceSAndroid Build Coastguard Worker                 }
417*35238bceSAndroid Build Coastguard Worker             }
418*35238bceSAndroid Build Coastguard Worker             if (colorReadResult)
419*35238bceSAndroid Build Coastguard Worker                 break;
420*35238bceSAndroid Build Coastguard Worker         }
421*35238bceSAndroid Build Coastguard Worker     }
422*35238bceSAndroid Build Coastguard Worker 
423*35238bceSAndroid Build Coastguard Worker     log << tcu::TestLog::Message << "Occlusion query result:  Target " << (queryResult ? "visible" : "invisible")
424*35238bceSAndroid Build Coastguard Worker         << "\n"
425*35238bceSAndroid Build Coastguard Worker         << "Framebuffer read result: Target " << (colorReadResult ? "visible" : "invisible")
426*35238bceSAndroid Build Coastguard Worker         << tcu::TestLog::EndMessage;
427*35238bceSAndroid Build Coastguard Worker 
428*35238bceSAndroid Build Coastguard Worker     bool testOk = false;
429*35238bceSAndroid Build Coastguard Worker     if (m_queryMode == GL_ANY_SAMPLES_PASSED_CONSERVATIVE)
430*35238bceSAndroid Build Coastguard Worker     {
431*35238bceSAndroid Build Coastguard Worker         if (queryResult || colorReadResult)
432*35238bceSAndroid Build Coastguard Worker             testOk = queryResult; // Allow conservative occlusion query to return false positives.
433*35238bceSAndroid Build Coastguard Worker         else
434*35238bceSAndroid Build Coastguard Worker             testOk = queryResult == colorReadResult;
435*35238bceSAndroid Build Coastguard Worker     }
436*35238bceSAndroid Build Coastguard Worker     else
437*35238bceSAndroid Build Coastguard Worker         testOk = (queryResult == colorReadResult);
438*35238bceSAndroid Build Coastguard Worker 
439*35238bceSAndroid Build Coastguard Worker     if (!testOk)
440*35238bceSAndroid Build Coastguard Worker     {
441*35238bceSAndroid Build Coastguard Worker         log << tcu::TestLog::Image("Result image", "Result image", pixels);
442*35238bceSAndroid Build Coastguard Worker         log << tcu::TestLog::Message << "Case FAILED!" << tcu::TestLog::EndMessage;
443*35238bceSAndroid Build Coastguard Worker 
444*35238bceSAndroid Build Coastguard Worker         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
445*35238bceSAndroid Build Coastguard Worker         return STOP;
446*35238bceSAndroid Build Coastguard Worker     }
447*35238bceSAndroid Build Coastguard Worker 
448*35238bceSAndroid Build Coastguard Worker     log << tcu::TestLog::Message << "Case passed!" << tcu::TestLog::EndMessage;
449*35238bceSAndroid Build Coastguard Worker 
450*35238bceSAndroid Build Coastguard Worker     return (++m_iterNdx < NUM_CASE_ITERATIONS) ? CONTINUE : STOP;
451*35238bceSAndroid Build Coastguard Worker }
452*35238bceSAndroid Build Coastguard Worker 
OcclusionQueryTests(Context & context)453*35238bceSAndroid Build Coastguard Worker OcclusionQueryTests::OcclusionQueryTests(Context &context)
454*35238bceSAndroid Build Coastguard Worker     : TestCaseGroup(context, "occlusion_query", "Occlusion Query Tests")
455*35238bceSAndroid Build Coastguard Worker {
456*35238bceSAndroid Build Coastguard Worker }
457*35238bceSAndroid Build Coastguard Worker 
~OcclusionQueryTests(void)458*35238bceSAndroid Build Coastguard Worker OcclusionQueryTests::~OcclusionQueryTests(void)
459*35238bceSAndroid Build Coastguard Worker {
460*35238bceSAndroid Build Coastguard Worker }
461*35238bceSAndroid Build Coastguard Worker 
init(void)462*35238bceSAndroid Build Coastguard Worker void OcclusionQueryTests::init(void)
463*35238bceSAndroid Build Coastguard Worker {
464*35238bceSAndroid Build Coastguard Worker     // Strict occlusion query cases
465*35238bceSAndroid Build Coastguard Worker 
466*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor", "scissor", 1, 10, 1.6f, 1, 1, 0.3f, GL_ANY_SAMPLES_PASSED,
467*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR));
468*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "depth_write", "depth_write", 8, 10, 1.6f, 1, 7, 0.3f,
469*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE));
470*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "depth_clear", "depth_clear", 5, 10, 1.6f, 1, 5, 0.2f,
471*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR));
472*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "stencil_write", "stencil_write", 8, 10, 2.0f, 1, 5, 0.4f,
473*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_WRITE));
474*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "stencil_clear", "stencil_clear", 5, 10, 2.0f, 1, 3, 0.3f,
475*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_CLEAR));
476*35238bceSAndroid Build Coastguard Worker 
477*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_depth_write", "scissor_depth_write", 5, 10, 1.6f, 2, 5, 0.3f,
478*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE));
479*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_depth_clear", "scissor_depth_clear", 7, 10, 1.6f, 2, 5, 1.0f,
480*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR));
481*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_stencil_write", "scissor_stencil_write", 4, 10, 1.6f, 2, 5,
482*35238bceSAndroid Build Coastguard Worker                                     0.3f, GL_ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE));
483*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_stencil_clear", "scissor_stencil_clear", 4, 10, 1.6f, 2, 5,
484*35238bceSAndroid Build Coastguard Worker                                     1.0f, GL_ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_CLEAR));
485*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "depth_write_depth_clear", "depth_write_depth_clear", 7, 10, 1.6f, 1, 5,
486*35238bceSAndroid Build Coastguard Worker                                     0.2f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
487*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "depth_write_stencil_write", "depth_write_stencil_write", 8, 10, 1.6f, 1,
488*35238bceSAndroid Build Coastguard Worker                                     5, 0.3f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
489*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "depth_write_stencil_clear", "depth_write_stencil_clear", 8, 10, 1.6f, 1,
490*35238bceSAndroid Build Coastguard Worker                                     5, 0.3f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
491*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "depth_clear_stencil_write", "depth_clear_stencil_write", 8, 10, 1.6f, 1,
492*35238bceSAndroid Build Coastguard Worker                                     5, 0.3f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
493*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "depth_clear_stencil_clear", "depth_clear_stencil_clear", 12, 10, 1.6f,
494*35238bceSAndroid Build Coastguard Worker                                     1, 5, 0.2f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
495*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "stencil_write_stencil_clear", "stencil_write_stencil_clear", 5, 10,
496*35238bceSAndroid Build Coastguard Worker                                     2.0f, 1, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
497*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
498*35238bceSAndroid Build Coastguard Worker 
499*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_depth_write_depth_clear", "scissor_depth_write_depth_clear", 5,
500*35238bceSAndroid Build Coastguard Worker                                     10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
501*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
502*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_depth_write_stencil_write", "scissor_depth_write_stencil_write",
503*35238bceSAndroid Build Coastguard Worker                                     4, 10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
504*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
505*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_depth_write_stencil_clear", "scissor_depth_write_stencil_clear",
506*35238bceSAndroid Build Coastguard Worker                                     6, 10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
507*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
508*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_depth_clear_stencil_write", "scissor_depth_clear_stencil_write",
509*35238bceSAndroid Build Coastguard Worker                                     4, 10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
510*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
511*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "scissor_depth_clear_stencil_clear", "scissor_depth_clear_stencil_clear",
512*35238bceSAndroid Build Coastguard Worker                                     5, 10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
513*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
514*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
515*35238bceSAndroid Build Coastguard Worker         m_context, "scissor_stencil_write_stencil_clear", "scissor_stencil_write_stencil_clear", 4, 10, 1.6f, 2, 5,
516*35238bceSAndroid Build Coastguard Worker         0.4f, GL_ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
517*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
518*35238bceSAndroid Build Coastguard Worker         m_context, "depth_write_depth_clear_stencil_write", "depth_write_depth_clear_stencil_write", 7, 10, 1.6f, 2, 5,
519*35238bceSAndroid Build Coastguard Worker         0.4f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
520*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
521*35238bceSAndroid Build Coastguard Worker         m_context, "depth_write_depth_clear_stencil_clear", "depth_write_depth_clear_stencil_clear", 7, 10, 1.6f, 2, 5,
522*35238bceSAndroid Build Coastguard Worker         0.4f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
523*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
524*35238bceSAndroid Build Coastguard Worker         m_context, "depth_write_stencil_write_stencil_clear", "depth_write_stencil_write_stencil_clear", 7, 10, 1.6f, 2,
525*35238bceSAndroid Build Coastguard Worker         5, 0.4f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
526*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
527*35238bceSAndroid Build Coastguard Worker         m_context, "depth_clear_stencil_write_stencil_clear", "depth_clear_stencil_write_stencil_clear", 7, 10, 1.6f, 2,
528*35238bceSAndroid Build Coastguard Worker         5, 0.4f, GL_ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
529*35238bceSAndroid Build Coastguard Worker 
530*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
531*35238bceSAndroid Build Coastguard Worker         m_context, "scissor_depth_write_depth_clear_stencil_write", "scissor_depth_write_depth_clear_stencil_write", 4,
532*35238bceSAndroid Build Coastguard Worker         10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
533*35238bceSAndroid Build Coastguard Worker         OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
534*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
535*35238bceSAndroid Build Coastguard Worker         m_context, "scissor_depth_write_depth_clear_stencil_clear", "scissor_depth_write_depth_clear_stencil_clear", 4,
536*35238bceSAndroid Build Coastguard Worker         10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
537*35238bceSAndroid Build Coastguard Worker         OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
538*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
539*35238bceSAndroid Build Coastguard Worker         m_context, "scissor_depth_write_stencil_write_stencil_clear", "scissor_depth_write_stencil_write_stencil_clear",
540*35238bceSAndroid Build Coastguard Worker         5, 10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
541*35238bceSAndroid Build Coastguard Worker         OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
542*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
543*35238bceSAndroid Build Coastguard Worker         m_context, "scissor_depth_clear_stencil_write_stencil_clear", "scissor_depth_clear_stencil_write_stencil_clear",
544*35238bceSAndroid Build Coastguard Worker         4, 10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
545*35238bceSAndroid Build Coastguard Worker         OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
546*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
547*35238bceSAndroid Build Coastguard Worker         m_context, "depth_write_depth_clear_stencil_write_stencil_clear",
548*35238bceSAndroid Build Coastguard Worker         "depth_write_depth_clear_stencil_write_stencil_clear", 7, 10, 1.6f, 2, 5, 0.4f, GL_ANY_SAMPLES_PASSED,
549*35238bceSAndroid Build Coastguard Worker         OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
550*35238bceSAndroid Build Coastguard Worker 
551*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "all_occluders", "all_occluders", 7, 10, 1.6f, 3, 5, 0.6f,
552*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED,
553*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR |
554*35238bceSAndroid Build Coastguard Worker                                         OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
555*35238bceSAndroid Build Coastguard Worker 
556*35238bceSAndroid Build Coastguard Worker     // Conservative occlusion query cases
557*35238bceSAndroid Build Coastguard Worker 
558*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor", "conservative_scissor", 1, 10, 1.6f, 1, 1, 0.3f,
559*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR));
560*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write", "conservative_depth_write", 8, 10, 1.6f, 1,
561*35238bceSAndroid Build Coastguard Worker                                     7, 0.3f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE));
562*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_clear", "conservative_depth_clear", 5, 10, 1.6f, 1,
563*35238bceSAndroid Build Coastguard Worker                                     5, 0.2f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR));
564*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_stencil_write", "conservative_stencil_write", 8, 10, 2.0f,
565*35238bceSAndroid Build Coastguard Worker                                     1, 5, 0.4f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_WRITE));
566*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_stencil_clear", "conservative_stencil_clear", 5, 10, 2.0f,
567*35238bceSAndroid Build Coastguard Worker                                     1, 3, 0.3f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_CLEAR));
568*35238bceSAndroid Build Coastguard Worker 
569*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_write", "conservative_scissor_depth_write",
570*35238bceSAndroid Build Coastguard Worker                                     5, 10, 1.6f, 2, 5, 0.3f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
571*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE));
572*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_clear", "conservative_scissor_depth_clear",
573*35238bceSAndroid Build Coastguard Worker                                     7, 10, 1.6f, 2, 5, 1.0f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
574*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR));
575*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_stencil_write",
576*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_stencil_write", 4, 10, 1.6f, 2, 5, 0.3f,
577*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE));
578*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_stencil_clear",
579*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_stencil_clear", 4, 10, 1.6f, 2, 5, 1.0f,
580*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_CLEAR));
581*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write_depth_clear",
582*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_write_depth_clear", 7, 10, 1.6f, 1, 5, 0.2f,
583*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
584*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write_stencil_write",
585*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_write_stencil_write", 8, 10, 1.6f, 1, 5, 0.3f,
586*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
587*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write_stencil_clear",
588*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_write_stencil_clear", 8, 10, 1.6f, 1, 5, 0.3f,
589*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
590*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_clear_stencil_write",
591*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_clear_stencil_write", 8, 10, 1.6f, 1, 5, 0.3f,
592*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
593*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_clear_stencil_clear",
594*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_clear_stencil_clear", 12, 10, 1.6f, 1, 5, 0.2f,
595*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
596*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(
597*35238bceSAndroid Build Coastguard Worker         m_context, "conservative_stencil_write_stencil_clear", "conservative_stencil_write_stencil_clear", 5, 10, 2.0f,
598*35238bceSAndroid Build Coastguard Worker         1, 5, 0.4f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
599*35238bceSAndroid Build Coastguard Worker 
600*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_write_depth_clear",
601*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_write_depth_clear", 5, 10, 1.6f, 2, 5, 0.4f,
602*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
603*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
604*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_write_stencil_write",
605*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_write_stencil_write", 4, 10, 1.6f, 2, 5, 0.4f,
606*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
607*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
608*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_write_stencil_clear",
609*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_write_stencil_clear", 6, 10, 1.6f, 2, 5, 0.4f,
610*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
611*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
612*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_clear_stencil_write",
613*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_clear_stencil_write", 4, 10, 1.6f, 2, 5, 0.4f,
614*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
615*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
616*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_clear_stencil_clear",
617*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_clear_stencil_clear", 5, 10, 1.6f, 2, 5, 0.4f,
618*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
619*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
620*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_stencil_write_stencil_clear",
621*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_stencil_write_stencil_clear", 4, 10, 1.6f, 2, 5, 0.4f,
622*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
623*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
624*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write_depth_clear_stencil_write",
625*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_write_depth_clear_stencil_write", 7, 10, 1.6f, 2, 5, 0.4f,
626*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
627*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
628*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write_depth_clear_stencil_clear",
629*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_write_depth_clear_stencil_clear", 7, 10, 1.6f, 2, 5, 0.4f,
630*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
631*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
632*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write_stencil_write_stencil_clear",
633*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_write_stencil_write_stencil_clear", 7, 10, 1.6f, 2, 5, 0.4f,
634*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
635*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
636*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_clear_stencil_write_stencil_clear",
637*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_clear_stencil_write_stencil_clear", 7, 10, 1.6f, 2, 5, 0.4f,
638*35238bceSAndroid Build Coastguard Worker                                     GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
639*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
640*35238bceSAndroid Build Coastguard Worker 
641*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_write_depth_clear_stencil_write",
642*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_write_depth_clear_stencil_write", 4, 10, 1.6f, 2, 5,
643*35238bceSAndroid Build Coastguard Worker                                     0.4f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
644*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR |
645*35238bceSAndroid Build Coastguard Worker                                         OCCLUDER_STENCIL_WRITE));
646*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_write_depth_clear_stencil_clear",
647*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_write_depth_clear_stencil_clear", 4, 10, 1.6f, 2, 5,
648*35238bceSAndroid Build Coastguard Worker                                     0.4f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
649*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR |
650*35238bceSAndroid Build Coastguard Worker                                         OCCLUDER_STENCIL_CLEAR));
651*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_write_stencil_write_stencil_clear",
652*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_write_stencil_write_stencil_clear", 5, 10, 1.6f, 2, 5,
653*35238bceSAndroid Build Coastguard Worker                                     0.4f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
654*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE |
655*35238bceSAndroid Build Coastguard Worker                                         OCCLUDER_STENCIL_CLEAR));
656*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_scissor_depth_clear_stencil_write_stencil_clear",
657*35238bceSAndroid Build Coastguard Worker                                     "conservative_scissor_depth_clear_stencil_write_stencil_clear", 4, 10, 1.6f, 2, 5,
658*35238bceSAndroid Build Coastguard Worker                                     0.4f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
659*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE |
660*35238bceSAndroid Build Coastguard Worker                                         OCCLUDER_STENCIL_CLEAR));
661*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_depth_write_depth_clear_stencil_write_stencil_clear",
662*35238bceSAndroid Build Coastguard Worker                                     "conservative_depth_write_depth_clear_stencil_write_stencil_clear", 7, 10, 1.6f, 2,
663*35238bceSAndroid Build Coastguard Worker                                     5, 0.4f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
664*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE |
665*35238bceSAndroid Build Coastguard Worker                                         OCCLUDER_STENCIL_CLEAR));
666*35238bceSAndroid Build Coastguard Worker 
667*35238bceSAndroid Build Coastguard Worker     addChild(new OcclusionQueryCase(m_context, "conservative_all_occluders", "conservative_all_occluders", 7, 10, 1.6f,
668*35238bceSAndroid Build Coastguard Worker                                     3, 5, 0.6f, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
669*35238bceSAndroid Build Coastguard Worker                                     OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR |
670*35238bceSAndroid Build Coastguard Worker                                         OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
671*35238bceSAndroid Build Coastguard Worker }
672*35238bceSAndroid Build Coastguard Worker 
673*35238bceSAndroid Build Coastguard Worker } // namespace Functional
674*35238bceSAndroid Build Coastguard Worker } // namespace gles3
675*35238bceSAndroid Build Coastguard Worker } // namespace deqp
676