xref: /aosp_15_r20/external/deqp/external/openglcts/modules/gl/gl4cPostDepthCoverageTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 /*-------------------------------------------------------------------------
2  * OpenGL Conformance Test Suite
3  * -----------------------------
4  *
5  * Copyright (c) 2016 The Khronos Group Inc.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */ /*!
20  * \file
21  * \brief
22  */ /*-------------------------------------------------------------------*/
23 
24 /**
25  */ /*!
26  * \file  gl4cPostDepthCoverageTests.cpp
27  * \brief Conformance tests for the GL_ARB_post_depth_coverage functionality.
28  */ /*-------------------------------------------------------------------*/
29 
30 #include "gl4cPostDepthCoverageTests.hpp"
31 #include "gluContextInfo.hpp"
32 #include "gluDefs.hpp"
33 #include "gluDrawUtil.hpp"
34 #include "gluShaderProgram.hpp"
35 #include "glwEnums.hpp"
36 #include "glwFunctions.hpp"
37 #include "tcuTestLog.hpp"
38 
39 using namespace glw;
40 using namespace glu;
41 
42 namespace gl4cts
43 {
44 static const char *c_commonVertShader = "#version 450\n"
45                                         "\n"
46                                         "in vec3 vertex;\n"
47                                         "in vec2 inTexCoord;\n"
48                                         "out vec2 texCoord;\n"
49                                         "\n"
50                                         "void main()\n"
51                                         "{\n"
52                                         "    texCoord = inTexCoord;\n"
53                                         "    gl_Position = vec4(vertex, 1);\n"
54                                         "}\n";
55 
56 /** Constructor.
57  *
58  *  @param context     Rendering context
59  */
PostDepthShaderCase(deqp::Context & context)60 PostDepthShaderCase::PostDepthShaderCase(deqp::Context &context)
61     : TestCase(context, "PostDepthShader",
62                "Verifies if shader functionality added in ARB_post_depth_coverage extension works as expected")
63 {
64     /* Left blank intentionally */
65 }
66 
67 /** Stub deinit method. */
deinit()68 void PostDepthShaderCase::deinit()
69 {
70 }
71 
72 /** Stub init method */
init()73 void PostDepthShaderCase::init()
74 {
75     if (!m_context.getContextInfo().isExtensionSupported("GL_ARB_post_depth_coverage"))
76         throw tcu::NotSupportedError("GL_ARB_post_depth_coverage not supported");
77 
78     m_vertShader = c_commonVertShader;
79 
80     m_fragShader1 = "#version 450\n"
81                     "\n"
82                     "#extension GL_ARB_post_depth_coverage : require\n"
83                     "\n"
84                     "out vec4 fragColor;\n"
85                     "\n"
86                     "void main()\n"
87                     "{\n"
88                     "    fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
89                     "}\n";
90 
91     m_fragShader2 = "#version 450\n"
92                     "\n"
93                     "#extension GL_ARB_post_depth_coverage : enable\n"
94                     "\n"
95                     "#ifndef GL_ARB_post_depth_coverage\n"
96                     "  #error GL_ARB_post_depth_coverage not defined\n"
97                     "#else\n"
98                     "  #if (GL_ARB_post_depth_coverage != 1)\n"
99                     "    #error GL_ARB_post_depth_coverage wrong defined\n"
100                     "  #endif\n"
101                     "#endif // GL_ARB_post_depth_coverage\n"
102                     "\n"
103                     "out vec4 fragColor;\n"
104                     "\n"
105                     "void main()\n"
106                     "{\n"
107                     "    fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
108                     "}\n";
109 
110     m_fragShader3 = "#version 450\n"
111                     "\n"
112                     "#extension GL_ARB_post_depth_coverage : enable\n"
113                     "\n"
114                     "layout(early_fragment_tests) in;\n"
115                     "layout(post_depth_coverage) in;\n"
116                     "\n"
117                     "out vec4 fragColor;\n"
118                     "\n"
119                     "void main()\n"
120                     "{\n"
121                     "    fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
122                     "}\n";
123 
124     m_fragShader4 = "#version 450\n"
125                     "\n"
126                     "#extension GL_ARB_post_depth_coverage : enable\n"
127                     "\n"
128                     "layout(post_depth_coverage) in;\n"
129                     "\n"
130                     "out vec4 fragColor;\n"
131                     "\n"
132                     "void main()\n"
133                     "{\n"
134                     "    fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
135                     "}\n";
136 }
137 
138 /** Executes test iteration.
139  *
140  *  @return Returns STOP when test has finished executing, CONTINUE if more iterations are needed.
141  */
iterate()142 tcu::TestNode::IterateResult PostDepthShaderCase::iterate()
143 {
144     const Functions &gl = m_context.getRenderContext().getFunctions();
145 
146     ProgramSources sources1 = makeVtxFragSources(m_vertShader, m_fragShader1);
147     ShaderProgram program1(gl, sources1);
148 
149     if (!program1.isOk())
150     {
151         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail checking extension in shader");
152         m_testCtx.getLog() << tcu::TestLog::Message << "Vertex: " << program1.getShaderInfo(SHADERTYPE_VERTEX).infoLog
153                            << "\n"
154                            << "Fragment: " << program1.getShaderInfo(SHADERTYPE_FRAGMENT).infoLog << "\n"
155                            << "Program: " << program1.getProgramInfo().infoLog << tcu::TestLog::EndMessage;
156 
157         return STOP;
158     }
159 
160     ProgramSources sources2 = makeVtxFragSources(m_vertShader, m_fragShader2);
161     ShaderProgram program2(gl, sources2);
162 
163     if (!program2.isOk())
164     {
165         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail checking preprocessor directives in shader");
166         m_testCtx.getLog() << tcu::TestLog::Message << "Vertex: " << program2.getShaderInfo(SHADERTYPE_VERTEX).infoLog
167                            << "\n"
168                            << "Fragment: " << program2.getShaderInfo(SHADERTYPE_FRAGMENT).infoLog << "\n"
169                            << "Program: " << program2.getProgramInfo().infoLog << tcu::TestLog::EndMessage;
170         return STOP;
171     }
172 
173     ProgramSources sources3 = makeVtxFragSources(m_vertShader, m_fragShader3);
174     ShaderProgram program3(gl, sources3);
175 
176     if (!program3.isOk())
177     {
178         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail checking first layout setup in shader");
179         m_testCtx.getLog() << tcu::TestLog::Message << "Vertex: " << program3.getShaderInfo(SHADERTYPE_VERTEX).infoLog
180                            << "\n"
181                            << "Fragment: " << program3.getShaderInfo(SHADERTYPE_FRAGMENT).infoLog << "\n"
182                            << "Program: " << program3.getProgramInfo().infoLog << tcu::TestLog::EndMessage;
183         return STOP;
184     }
185 
186     ProgramSources sources4 = makeVtxFragSources(m_vertShader, m_fragShader4);
187     ShaderProgram program4(gl, sources4);
188 
189     if (!program4.isOk())
190     {
191         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail checking second layout setup in shader");
192         m_testCtx.getLog() << tcu::TestLog::Message << "Vertex: " << program4.getShaderInfo(SHADERTYPE_VERTEX).infoLog
193                            << "\n"
194                            << "Fragment: " << program4.getShaderInfo(SHADERTYPE_FRAGMENT).infoLog << "\n"
195                            << "Program: " << program4.getProgramInfo().infoLog << tcu::TestLog::EndMessage;
196         return STOP;
197     }
198 
199     m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
200     return STOP;
201 }
202 
203 /** Constructor.
204  *
205  *  @param context     Rendering context
206  */
PostDepthSampleMaskCase(deqp::Context & context)207 PostDepthSampleMaskCase::PostDepthSampleMaskCase(deqp::Context &context)
208     : TestCase(context, "PostDepthSampleMask",
209                "Verifies multisampling with depth test and stencil test functionality "
210                "added in ARB_post_depth_coverage extension")
211     , m_framebufferMS(0)
212     , m_framebuffer(0)
213     , m_textureMS(0)
214     , m_texture(0)
215     , m_depthStencilRenderbuffer(0)
216 {
217     /* Left blank intentionally */
218 }
219 
220 /** Stub deinit method. */
deinit()221 void PostDepthSampleMaskCase::deinit()
222 {
223     const Functions &gl = m_context.getRenderContext().getFunctions();
224 
225     gl.bindFramebuffer(GL_FRAMEBUFFER, 0);
226 
227     if (m_framebufferMS)
228         gl.deleteFramebuffers(1, &m_framebufferMS);
229     if (m_framebuffer)
230         gl.deleteFramebuffers(1, &m_framebuffer);
231 
232     if (m_textureMS)
233         gl.deleteTextures(1, &m_textureMS);
234     if (m_texture)
235         gl.deleteTextures(1, &m_texture);
236 
237     if (m_depthStencilRenderbuffer)
238         gl.deleteRenderbuffers(1, &m_depthStencilRenderbuffer);
239 }
240 
241 /** Stub init method */
init()242 void PostDepthSampleMaskCase::init()
243 {
244     if (!m_context.getContextInfo().isExtensionSupported("GL_ARB_post_depth_coverage"))
245         throw tcu::NotSupportedError("GL_ARB_post_depth_coverage not supported");
246 
247     m_vertShader = c_commonVertShader;
248 
249     m_fragShader1a = "#version 450\n"
250                      "\n"
251                      "#extension GL_ARB_post_depth_coverage : enable\n"
252                      "\n"
253                      "in vec2 texCoord;\n"
254                      "out vec4 fragColor;\n"
255                      "\n"
256                      "void main()\n"
257                      "{\n"
258                      "    int samp1 = (gl_SampleMaskIn[0] & 0x1);\n"
259                      "    int samp2 = (gl_SampleMaskIn[0] & 0x2) / 2;\n"
260                      "    int samp3 = (gl_SampleMaskIn[0] & 0x4) / 4;\n"
261                      "    int samp4 = (gl_SampleMaskIn[0] & 0x8) / 8;\n"
262                      "    fragColor = vec4(samp1, samp2, samp3, samp4);\n"
263                      "}\n";
264 
265     m_fragShader1b = "#version 450\n"
266                      "\n"
267                      "#extension GL_ARB_post_depth_coverage : enable\n"
268                      "layout(post_depth_coverage) in;\n"
269                      "\n"
270                      "in vec2 texCoord;\n"
271                      "out vec4 fragColor;\n"
272                      "\n"
273                      "void main()\n"
274                      "{\n"
275                      "    int samp1 = (gl_SampleMaskIn[0] & 0x1);\n"
276                      "    int samp2 = (gl_SampleMaskIn[0] & 0x2) / 2;\n"
277                      "    int samp3 = (gl_SampleMaskIn[0] & 0x4) / 4;\n"
278                      "    int samp4 = (gl_SampleMaskIn[0] & 0x8) / 8;\n"
279                      "    fragColor = vec4(samp1, samp2, samp3, samp4);\n"
280                      "}\n";
281 
282     m_fragShader2 = "#version 450\n"
283                     "\n"
284                     "in vec2 texCoord;\n"
285                     "out vec4 fragColor;\n"
286                     "\n"
287                     "uniform sampler2DMS texture;\n"
288                     "\n"
289                     "void main()\n"
290                     "{\n"
291                     "    int samp = int(texCoord.y * 4);\n"
292                     "    fragColor = texelFetch(texture, ivec2(0, 0), samp);\n"
293                     "}\n";
294 
295     const Functions &gl = m_context.getRenderContext().getFunctions();
296 
297     gl.genRenderbuffers(1, &m_depthStencilRenderbuffer);
298     gl.bindRenderbuffer(GL_RENDERBUFFER, m_depthStencilRenderbuffer);
299     gl.renderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_DEPTH_STENCIL, 1, 1);
300     GLU_EXPECT_NO_ERROR(gl.getError(), "glRenderbufferStorageMultisample");
301 
302     gl.genTextures(1, &m_textureMS);
303     gl.bindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_textureMS);
304     gl.texStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGBA8, 1, 1, GL_TRUE);
305     GLU_EXPECT_NO_ERROR(gl.getError(), "glTexStorage2DMultisample");
306 
307     gl.genFramebuffers(1, &m_framebufferMS);
308     gl.bindFramebuffer(GL_FRAMEBUFFER, m_framebufferMS);
309     gl.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, m_textureMS, 0);
310     gl.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilRenderbuffer);
311     gl.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilRenderbuffer);
312 
313     gl.genTextures(1, &m_texture);
314     gl.bindTexture(GL_TEXTURE_2D, m_texture);
315     gl.texStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 1, 4);
316 
317     gl.genFramebuffers(1, &m_framebuffer);
318     gl.bindFramebuffer(GL_FRAMEBUFFER, m_framebuffer);
319     gl.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture, 0);
320 }
321 
322 /** Executes test iteration.
323  *
324  *  @return Returns STOP when test has finished executing, CONTINUE if more iterations are needed.
325  */
iterate()326 tcu::TestNode::IterateResult PostDepthSampleMaskCase::iterate()
327 {
328     const Functions &gl = m_context.getRenderContext().getFunctions();
329 
330     const GLfloat texCoord[] = {
331         0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f,
332     };
333 
334     const GLfloat verticesNear[] = {
335         -1.0f, -1.0f, 0.25f, 0.4f, -1.0f, 0.25f, -1.0f, 0.4f, 0.25f,
336     };
337 
338     const GLfloat verticesFar[] = {
339         -1.0f, -1.0f, 0.75f, 3.0f, -1.0f, 0.75f, -1.0f, 3.0f, 0.75f,
340     };
341 
342     const GLfloat verticesPost[] = {
343         -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f,
344     };
345 
346     const GLuint indicesPre[] = {0, 1, 2};
347 
348     const GLuint indicesPost[] = {0, 1, 2, 1, 2, 3};
349 
350     glu::VertexArrayBinding vertexArraysNear[] = {glu::va::Float("vertex", 3, 3, 0, verticesNear),
351                                                   glu::va::Float("inTexCoord", 2, 3, 0, texCoord)};
352 
353     glu::VertexArrayBinding vertexArraysFar[] = {glu::va::Float("vertex", 3, 3, 0, verticesFar),
354                                                  glu::va::Float("inTexCoord", 2, 3, 0, texCoord)};
355 
356     glu::VertexArrayBinding vertexArraysPost[] = {glu::va::Float("vertex", 3, 4, 0, verticesPost),
357                                                   glu::va::Float("inTexCoord", 2, 4, 0, texCoord)};
358 
359     //Prepare shaders
360     ProgramSources sources1a = makeVtxFragSources(m_vertShader, m_fragShader1a);
361     ShaderProgram program1a(gl, sources1a);
362 
363     if (!program1a.isOk())
364     {
365         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Shader program fail (non post_depth_coverage).");
366         m_testCtx.getLog() << tcu::TestLog::Message << "Vertex: " << program1a.getShaderInfo(SHADERTYPE_VERTEX).infoLog
367                            << "\n"
368                            << "Fragment: " << program1a.getShaderInfo(SHADERTYPE_FRAGMENT).infoLog << "\n"
369                            << "Program: " << program1a.getProgramInfo().infoLog << tcu::TestLog::EndMessage;
370         return STOP;
371     }
372 
373     ProgramSources sources1b = makeVtxFragSources(m_vertShader, m_fragShader1b);
374     ShaderProgram program1b(gl, sources1b);
375 
376     if (!program1b.isOk())
377     {
378         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Shader program fail (post_depth_coverage).");
379         m_testCtx.getLog() << tcu::TestLog::Message << "PostDepthCoverage: enabled\n"
380                            << "Vertex: " << program1b.getShaderInfo(SHADERTYPE_VERTEX).infoLog << "\n"
381                            << "Fragment: " << program1b.getShaderInfo(SHADERTYPE_FRAGMENT).infoLog << "\n"
382                            << "Program: " << program1b.getProgramInfo().infoLog << tcu::TestLog::EndMessage;
383         return STOP;
384     }
385 
386     ProgramSources sources2 = makeVtxFragSources(m_vertShader, m_fragShader2);
387     ShaderProgram program2(gl, sources2);
388 
389     if (!program2.isOk())
390     {
391         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Shader program fail (samples reader).");
392         m_testCtx.getLog() << tcu::TestLog::Message << "Vertex: " << program2.getShaderInfo(SHADERTYPE_VERTEX).infoLog
393                            << "\n"
394                            << "Fragment: " << program2.getShaderInfo(SHADERTYPE_FRAGMENT).infoLog << "\n"
395                            << "Program: " << program2.getProgramInfo().infoLog << tcu::TestLog::EndMessage;
396         return STOP;
397     }
398 
399     gl.clearColor(0.0f, 0.0f, 0.0f, 0.0f);
400     gl.clearStencil(0);
401 
402     //Iterate through all cases
403     for (int bufferCase = BUFFERCASE_FIRST; bufferCase <= BUFFERCASE_LAST; ++bufferCase)
404         for (int pdcCase = PDCCASE_FIRST; pdcCase <= PDCCASE_LAST; ++pdcCase)
405         {
406             GLint program = 0;
407             if (pdcCase == PDCCASE_DISABLED)
408                 program = program1a.getProgram();
409             else if (pdcCase == PDCCASE_ENABLED)
410                 program = program1b.getProgram();
411 
412             gl.useProgram(program);
413 
414             //Firstible use multisampled framebuffer
415             gl.bindFramebuffer(GL_FRAMEBUFFER, m_framebufferMS);
416             gl.viewport(0, 0, 1, 1);
417 
418             gl.enable(GL_MULTISAMPLE);
419 
420             //Check which samples should be covered by first draw - calculate expected sample mask
421             GLboolean expectedMask[4];
422 
423             for (GLint i = 0; i < 4; ++i)
424             {
425                 GLfloat samplePos[2];
426                 gl.getMultisamplefv(GL_SAMPLE_POSITION, i, &samplePos[0]);
427                 GLU_EXPECT_NO_ERROR(gl.getError(), "glGetMultisamplefv");
428                 if (pdcCase == PDCCASE_ENABLED && (samplePos[0] + samplePos[1]) < 0.7f)
429                     expectedMask[i] = false;
430                 else
431                     expectedMask[i] = true;
432             }
433 
434             if (bufferCase == BUFFERCASE_DEPTH)
435                 gl.enable(GL_DEPTH_TEST);
436             else if (bufferCase == BUFFERCASE_STENCIL)
437                 gl.enable(GL_STENCIL_TEST);
438 
439             gl.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
440 
441             if (bufferCase == BUFFERCASE_STENCIL)
442             {
443                 gl.stencilFunc(GL_ALWAYS, 1, 0xFF);
444                 gl.stencilOp(GL_ZERO, GL_REPLACE, GL_REPLACE);
445                 gl.stencilMask(0xFF);
446             }
447 
448             //Draw near primitive
449             glu::draw(m_context.getRenderContext(), program, DE_LENGTH_OF_ARRAY(vertexArraysNear), vertexArraysNear,
450                       glu::pr::TriangleStrip(DE_LENGTH_OF_ARRAY(indicesPre), indicesPre));
451 
452             gl.clear(GL_COLOR_BUFFER_BIT);
453 
454             if (bufferCase == BUFFERCASE_STENCIL)
455             {
456                 gl.stencilFunc(GL_NOTEQUAL, 1, 0xFF);
457                 gl.stencilMask(0x00);
458             }
459 
460             //Draw far primitive
461             glu::draw(m_context.getRenderContext(), program, DE_LENGTH_OF_ARRAY(vertexArraysFar), vertexArraysFar,
462                       glu::pr::TriangleStrip(DE_LENGTH_OF_ARRAY(indicesPre), indicesPre));
463 
464             gl.disable(GL_DEPTH_TEST);
465             if (bufferCase == BUFFERCASE_DEPTH)
466                 gl.disable(GL_DEPTH_TEST);
467             else if (bufferCase == BUFFERCASE_STENCIL)
468                 gl.disable(GL_STENCIL_TEST);
469 
470             gl.bindFramebuffer(GL_FRAMEBUFFER, 0);
471 
472             gl.useProgram(program2.getProgram());
473 
474             gl.bindFramebuffer(GL_FRAMEBUFFER, m_framebuffer);
475             gl.viewport(0, 0, 1, 4);
476 
477             //Pass multisampled texture as a uniform
478             gl.activeTexture(GL_TEXTURE0);
479             gl.bindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_textureMS);
480             gl.uniform1i(gl.getUniformLocation(program2.getProgram(), "texture"), 0);
481 
482             gl.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
483 
484             //Draw multisampled texture to framebuffer
485             glu::draw(m_context.getRenderContext(), program2.getProgram(), DE_LENGTH_OF_ARRAY(vertexArraysPost),
486                       vertexArraysPost, glu::pr::TriangleStrip(DE_LENGTH_OF_ARRAY(indicesPost), indicesPost));
487 
488             gl.disable(GL_MULTISAMPLE);
489 
490             //Read data from framebuffer
491             GLubyte pixels[4 * 4];
492             deMemset(pixels, 0, 4 * 4);
493 
494             gl.readPixels(0, 0, 1, 4, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
495             GLU_EXPECT_NO_ERROR(gl.getError(), "glReadPixels");
496 
497             //Verify the result
498             GLboolean compiledMask[4];
499             deMemset(compiledMask, 0, 4);
500             for (int i = 0; i < 4; ++i)
501             {
502                 for (int n = 0; n < 4; ++n)
503                     compiledMask[n] = compiledMask[n] || (pixels[4 * i + n] != 0);
504             }
505 
506             for (int n = 0; n < 4; ++n)
507             {
508                 if (expectedMask[n] != compiledMask[n])
509                 {
510                     m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
511                     m_testCtx.getLog() << tcu::TestLog::Message << "Wrong results for "
512                                        << (bufferCase == BUFFERCASE_DEPTH ? "BUFFERCASE_DEPTH" :
513                                                                             "BUFFERCASE_DEPTH_STENCIL")
514                                        << " / "
515                                        << (pdcCase == PDCCASE_DISABLED ? "PDCCASE_DISABLED" : "PDCCASE_ENABLED")
516                                        << tcu::TestLog::EndMessage;
517                     return STOP;
518                 }
519             }
520         }
521 
522     m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
523     return STOP;
524 }
525 
526 /** Constructor.
527  *
528  *  @param context Rendering context.
529  */
PostDepthCoverage(deqp::Context & context)530 PostDepthCoverage::PostDepthCoverage(deqp::Context &context)
531     : TestCaseGroup(context, "post_depth_coverage_tests",
532                     "Verify conformance of CTS_ARB_post_depth_coverage implementation")
533 {
534 }
535 
536 /** Initializes the test group contents. */
init()537 void PostDepthCoverage::init()
538 {
539     addChild(new PostDepthShaderCase(m_context));
540     addChild(new PostDepthSampleMaskCase(m_context));
541 }
542 
543 } // namespace gl4cts
544