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 Depth tests.
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "es3fDepthTests.hpp"
25*35238bceSAndroid Build Coastguard Worker
26*35238bceSAndroid Build Coastguard Worker #include "tcuTestLog.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "gluPixelTransfer.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "tcuImageCompare.hpp"
29*35238bceSAndroid Build Coastguard Worker #include "tcuRenderTarget.hpp"
30*35238bceSAndroid Build Coastguard Worker #include "gluStrUtil.hpp"
31*35238bceSAndroid Build Coastguard Worker
32*35238bceSAndroid Build Coastguard Worker #include "sglrContextUtil.hpp"
33*35238bceSAndroid Build Coastguard Worker #include "sglrReferenceContext.hpp"
34*35238bceSAndroid Build Coastguard Worker #include "sglrGLContext.hpp"
35*35238bceSAndroid Build Coastguard Worker
36*35238bceSAndroid Build Coastguard Worker #include "deRandom.hpp"
37*35238bceSAndroid Build Coastguard Worker
38*35238bceSAndroid Build Coastguard Worker #include "glwEnums.hpp"
39*35238bceSAndroid Build Coastguard Worker
40*35238bceSAndroid Build Coastguard Worker using tcu::RGBA;
41*35238bceSAndroid Build Coastguard Worker
42*35238bceSAndroid Build Coastguard Worker namespace deqp
43*35238bceSAndroid Build Coastguard Worker {
44*35238bceSAndroid Build Coastguard Worker namespace gles3
45*35238bceSAndroid Build Coastguard Worker {
46*35238bceSAndroid Build Coastguard Worker namespace Functional
47*35238bceSAndroid Build Coastguard Worker {
48*35238bceSAndroid Build Coastguard Worker
49*35238bceSAndroid Build Coastguard Worker class DepthShader : public sglr::ShaderProgram
50*35238bceSAndroid Build Coastguard Worker {
51*35238bceSAndroid Build Coastguard Worker public:
52*35238bceSAndroid Build Coastguard Worker DepthShader(void);
53*35238bceSAndroid Build Coastguard Worker
54*35238bceSAndroid Build Coastguard Worker void setColor(sglr::Context &ctx, uint32_t programID, const tcu::Vec4 &color);
55*35238bceSAndroid Build Coastguard Worker
56*35238bceSAndroid Build Coastguard Worker private:
57*35238bceSAndroid Build Coastguard Worker void shadeVertices(const rr::VertexAttrib *inputs, rr::VertexPacket *const *packets, const int numPackets) const;
58*35238bceSAndroid Build Coastguard Worker void shadeFragments(rr::FragmentPacket *packets, const int numPackets,
59*35238bceSAndroid Build Coastguard Worker const rr::FragmentShadingContext &context) const;
60*35238bceSAndroid Build Coastguard Worker
61*35238bceSAndroid Build Coastguard Worker const sglr::UniformSlot &u_color;
62*35238bceSAndroid Build Coastguard Worker };
63*35238bceSAndroid Build Coastguard Worker
DepthShader(void)64*35238bceSAndroid Build Coastguard Worker DepthShader::DepthShader(void)
65*35238bceSAndroid Build Coastguard Worker : sglr::ShaderProgram(sglr::pdec::ShaderProgramDeclaration()
66*35238bceSAndroid Build Coastguard Worker << sglr::pdec::VertexAttribute("a_position", rr::GENERICVECTYPE_FLOAT)
67*35238bceSAndroid Build Coastguard Worker << sglr::pdec::FragmentOutput(rr::GENERICVECTYPE_FLOAT)
68*35238bceSAndroid Build Coastguard Worker << sglr::pdec::Uniform("u_color", glu::TYPE_FLOAT_VEC4)
69*35238bceSAndroid Build Coastguard Worker << sglr::pdec::VertexSource("#version 300 es\n"
70*35238bceSAndroid Build Coastguard Worker "in highp vec4 a_position;\n"
71*35238bceSAndroid Build Coastguard Worker "void main (void)\n"
72*35238bceSAndroid Build Coastguard Worker "{\n"
73*35238bceSAndroid Build Coastguard Worker " gl_Position = a_position;\n"
74*35238bceSAndroid Build Coastguard Worker "}\n")
75*35238bceSAndroid Build Coastguard Worker << sglr::pdec::FragmentSource("#version 300 es\n"
76*35238bceSAndroid Build Coastguard Worker "uniform highp vec4 u_color;\n"
77*35238bceSAndroid Build Coastguard Worker "layout(location = 0) out mediump vec4 o_color;\n"
78*35238bceSAndroid Build Coastguard Worker "void main (void)\n"
79*35238bceSAndroid Build Coastguard Worker "{\n"
80*35238bceSAndroid Build Coastguard Worker " o_color = u_color;\n"
81*35238bceSAndroid Build Coastguard Worker "}\n"))
82*35238bceSAndroid Build Coastguard Worker , u_color(getUniformByName("u_color"))
83*35238bceSAndroid Build Coastguard Worker {
84*35238bceSAndroid Build Coastguard Worker }
85*35238bceSAndroid Build Coastguard Worker
setColor(sglr::Context & ctx,uint32_t programID,const tcu::Vec4 & color)86*35238bceSAndroid Build Coastguard Worker void DepthShader::setColor(sglr::Context &ctx, uint32_t programID, const tcu::Vec4 &color)
87*35238bceSAndroid Build Coastguard Worker {
88*35238bceSAndroid Build Coastguard Worker ctx.useProgram(programID);
89*35238bceSAndroid Build Coastguard Worker ctx.uniform4fv(ctx.getUniformLocation(programID, "u_color"), 1, color.getPtr());
90*35238bceSAndroid Build Coastguard Worker }
91*35238bceSAndroid Build Coastguard Worker
shadeVertices(const rr::VertexAttrib * inputs,rr::VertexPacket * const * packets,const int numPackets) const92*35238bceSAndroid Build Coastguard Worker void DepthShader::shadeVertices(const rr::VertexAttrib *inputs, rr::VertexPacket *const *packets,
93*35238bceSAndroid Build Coastguard Worker const int numPackets) const
94*35238bceSAndroid Build Coastguard Worker {
95*35238bceSAndroid Build Coastguard Worker for (int packetNdx = 0; packetNdx < numPackets; ++packetNdx)
96*35238bceSAndroid Build Coastguard Worker packets[packetNdx]->position =
97*35238bceSAndroid Build Coastguard Worker rr::readVertexAttribFloat(inputs[0], packets[packetNdx]->instanceNdx, packets[packetNdx]->vertexNdx);
98*35238bceSAndroid Build Coastguard Worker }
99*35238bceSAndroid Build Coastguard Worker
shadeFragments(rr::FragmentPacket * packets,const int numPackets,const rr::FragmentShadingContext & context) const100*35238bceSAndroid Build Coastguard Worker void DepthShader::shadeFragments(rr::FragmentPacket *packets, const int numPackets,
101*35238bceSAndroid Build Coastguard Worker const rr::FragmentShadingContext &context) const
102*35238bceSAndroid Build Coastguard Worker {
103*35238bceSAndroid Build Coastguard Worker const tcu::Vec4 color(u_color.value.f4);
104*35238bceSAndroid Build Coastguard Worker
105*35238bceSAndroid Build Coastguard Worker DE_UNREF(packets);
106*35238bceSAndroid Build Coastguard Worker
107*35238bceSAndroid Build Coastguard Worker for (int packetNdx = 0; packetNdx < numPackets; ++packetNdx)
108*35238bceSAndroid Build Coastguard Worker for (int fragNdx = 0; fragNdx < 4; ++fragNdx)
109*35238bceSAndroid Build Coastguard Worker rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, color);
110*35238bceSAndroid Build Coastguard Worker }
111*35238bceSAndroid Build Coastguard Worker
112*35238bceSAndroid Build Coastguard Worker // \todo [2011-07-11 pyry] This code is duplicated in a quite many places. Move it to some utility?
113*35238bceSAndroid Build Coastguard Worker class DepthCase : public TestCase
114*35238bceSAndroid Build Coastguard Worker {
115*35238bceSAndroid Build Coastguard Worker public:
116*35238bceSAndroid Build Coastguard Worker DepthCase(Context &context, const char *name, const char *description);
~DepthCase(void)117*35238bceSAndroid Build Coastguard Worker virtual ~DepthCase(void)
118*35238bceSAndroid Build Coastguard Worker {
119*35238bceSAndroid Build Coastguard Worker }
120*35238bceSAndroid Build Coastguard Worker
121*35238bceSAndroid Build Coastguard Worker virtual IterateResult iterate(void);
122*35238bceSAndroid Build Coastguard Worker virtual void render(sglr::Context &context) = DE_NULL;
123*35238bceSAndroid Build Coastguard Worker };
124*35238bceSAndroid Build Coastguard Worker
DepthCase(Context & context,const char * name,const char * description)125*35238bceSAndroid Build Coastguard Worker DepthCase::DepthCase(Context &context, const char *name, const char *description) : TestCase(context, name, description)
126*35238bceSAndroid Build Coastguard Worker {
127*35238bceSAndroid Build Coastguard Worker }
128*35238bceSAndroid Build Coastguard Worker
iterate(void)129*35238bceSAndroid Build Coastguard Worker TestCase::IterateResult DepthCase::iterate(void)
130*35238bceSAndroid Build Coastguard Worker {
131*35238bceSAndroid Build Coastguard Worker tcu::Vec4 clearColor = tcu::Vec4(0.125f, 0.25f, 0.5f, 1.0f);
132*35238bceSAndroid Build Coastguard Worker glu::RenderContext &renderCtx = m_context.getRenderContext();
133*35238bceSAndroid Build Coastguard Worker const tcu::RenderTarget &renderTarget = renderCtx.getRenderTarget();
134*35238bceSAndroid Build Coastguard Worker tcu::TestLog &log = m_testCtx.getLog();
135*35238bceSAndroid Build Coastguard Worker const char *failReason = DE_NULL;
136*35238bceSAndroid Build Coastguard Worker
137*35238bceSAndroid Build Coastguard Worker // Position & size for context
138*35238bceSAndroid Build Coastguard Worker de::Random rnd(deStringHash(getName()));
139*35238bceSAndroid Build Coastguard Worker
140*35238bceSAndroid Build Coastguard Worker int width = deMin32(renderTarget.getWidth(), 128);
141*35238bceSAndroid Build Coastguard Worker int height = deMin32(renderTarget.getHeight(), 128);
142*35238bceSAndroid Build Coastguard Worker int x = rnd.getInt(0, renderTarget.getWidth() - width);
143*35238bceSAndroid Build Coastguard Worker int y = rnd.getInt(0, renderTarget.getHeight() - height);
144*35238bceSAndroid Build Coastguard Worker
145*35238bceSAndroid Build Coastguard Worker tcu::Surface gles2Frame(width, height);
146*35238bceSAndroid Build Coastguard Worker tcu::Surface refFrame(width, height);
147*35238bceSAndroid Build Coastguard Worker uint32_t gles2Error;
148*35238bceSAndroid Build Coastguard Worker uint32_t refError;
149*35238bceSAndroid Build Coastguard Worker
150*35238bceSAndroid Build Coastguard Worker // Render using GLES2
151*35238bceSAndroid Build Coastguard Worker {
152*35238bceSAndroid Build Coastguard Worker sglr::GLContext context(renderCtx, log, sglr::GLCONTEXT_LOG_CALLS, tcu::IVec4(x, y, width, height));
153*35238bceSAndroid Build Coastguard Worker
154*35238bceSAndroid Build Coastguard Worker context.clearColor(clearColor.x(), clearColor.y(), clearColor.z(), clearColor.w());
155*35238bceSAndroid Build Coastguard Worker context.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
156*35238bceSAndroid Build Coastguard Worker
157*35238bceSAndroid Build Coastguard Worker render(context); // Call actual render func
158*35238bceSAndroid Build Coastguard Worker context.readPixels(gles2Frame, 0, 0, width, height);
159*35238bceSAndroid Build Coastguard Worker gles2Error = context.getError();
160*35238bceSAndroid Build Coastguard Worker }
161*35238bceSAndroid Build Coastguard Worker
162*35238bceSAndroid Build Coastguard Worker // Render reference image
163*35238bceSAndroid Build Coastguard Worker {
164*35238bceSAndroid Build Coastguard Worker sglr::ReferenceContextBuffers buffers(
165*35238bceSAndroid Build Coastguard Worker tcu::PixelFormat(8, 8, 8, renderTarget.getPixelFormat().alphaBits ? 8 : 0), renderTarget.getDepthBits(),
166*35238bceSAndroid Build Coastguard Worker renderTarget.getStencilBits(), width, height);
167*35238bceSAndroid Build Coastguard Worker sglr::ReferenceContext context(sglr::ReferenceContextLimits(renderCtx), buffers.getColorbuffer(),
168*35238bceSAndroid Build Coastguard Worker buffers.getDepthbuffer(), buffers.getStencilbuffer());
169*35238bceSAndroid Build Coastguard Worker
170*35238bceSAndroid Build Coastguard Worker context.clearColor(clearColor.x(), clearColor.y(), clearColor.z(), clearColor.w());
171*35238bceSAndroid Build Coastguard Worker context.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
172*35238bceSAndroid Build Coastguard Worker
173*35238bceSAndroid Build Coastguard Worker render(context);
174*35238bceSAndroid Build Coastguard Worker context.readPixels(refFrame, 0, 0, width, height);
175*35238bceSAndroid Build Coastguard Worker refError = context.getError();
176*35238bceSAndroid Build Coastguard Worker }
177*35238bceSAndroid Build Coastguard Worker
178*35238bceSAndroid Build Coastguard Worker // Compare error codes
179*35238bceSAndroid Build Coastguard Worker bool errorCodesOk = (gles2Error == refError);
180*35238bceSAndroid Build Coastguard Worker
181*35238bceSAndroid Build Coastguard Worker if (!errorCodesOk)
182*35238bceSAndroid Build Coastguard Worker {
183*35238bceSAndroid Build Coastguard Worker log << tcu::TestLog::Message << "Error code mismatch: got " << glu::getErrorStr(gles2Error) << ", expected "
184*35238bceSAndroid Build Coastguard Worker << glu::getErrorStr(refError) << tcu::TestLog::EndMessage;
185*35238bceSAndroid Build Coastguard Worker failReason = "Got unexpected error";
186*35238bceSAndroid Build Coastguard Worker }
187*35238bceSAndroid Build Coastguard Worker
188*35238bceSAndroid Build Coastguard Worker // Compare images
189*35238bceSAndroid Build Coastguard Worker const float threshold = 0.02f;
190*35238bceSAndroid Build Coastguard Worker bool imagesOk = tcu::fuzzyCompare(log, "ComparisonResult", "Image comparison result", refFrame, gles2Frame,
191*35238bceSAndroid Build Coastguard Worker threshold, tcu::COMPARE_LOG_RESULT);
192*35238bceSAndroid Build Coastguard Worker
193*35238bceSAndroid Build Coastguard Worker if (!imagesOk && !failReason)
194*35238bceSAndroid Build Coastguard Worker failReason = "Image comparison failed";
195*35238bceSAndroid Build Coastguard Worker
196*35238bceSAndroid Build Coastguard Worker // Store test result
197*35238bceSAndroid Build Coastguard Worker bool isOk = errorCodesOk && imagesOk;
198*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL, isOk ? "Pass" : failReason);
199*35238bceSAndroid Build Coastguard Worker
200*35238bceSAndroid Build Coastguard Worker return STOP;
201*35238bceSAndroid Build Coastguard Worker }
202*35238bceSAndroid Build Coastguard Worker
203*35238bceSAndroid Build Coastguard Worker class DepthCompareCase : public DepthCase
204*35238bceSAndroid Build Coastguard Worker {
205*35238bceSAndroid Build Coastguard Worker public:
DepthCompareCase(Context & context,const char * name,const char * description,uint32_t compareOp)206*35238bceSAndroid Build Coastguard Worker DepthCompareCase(Context &context, const char *name, const char *description, uint32_t compareOp)
207*35238bceSAndroid Build Coastguard Worker : DepthCase(context, name, description)
208*35238bceSAndroid Build Coastguard Worker , m_compareOp(compareOp)
209*35238bceSAndroid Build Coastguard Worker {
210*35238bceSAndroid Build Coastguard Worker }
211*35238bceSAndroid Build Coastguard Worker
render(sglr::Context & context)212*35238bceSAndroid Build Coastguard Worker void render(sglr::Context &context)
213*35238bceSAndroid Build Coastguard Worker {
214*35238bceSAndroid Build Coastguard Worker using tcu::Vec3;
215*35238bceSAndroid Build Coastguard Worker
216*35238bceSAndroid Build Coastguard Worker DepthShader shader;
217*35238bceSAndroid Build Coastguard Worker uint32_t shaderID = context.createProgram(&shader);
218*35238bceSAndroid Build Coastguard Worker
219*35238bceSAndroid Build Coastguard Worker tcu::Vec4 red(1.0f, 0.0f, 0.0f, 1.0);
220*35238bceSAndroid Build Coastguard Worker tcu::Vec4 green(0.0f, 1.0f, 0.0f, 1.0f);
221*35238bceSAndroid Build Coastguard Worker
222*35238bceSAndroid Build Coastguard Worker // Clear depth to 1
223*35238bceSAndroid Build Coastguard Worker context.clearDepthf(1.0f);
224*35238bceSAndroid Build Coastguard Worker context.clear(GL_DEPTH_BUFFER_BIT);
225*35238bceSAndroid Build Coastguard Worker
226*35238bceSAndroid Build Coastguard Worker // Enable depth test.
227*35238bceSAndroid Build Coastguard Worker context.enable(GL_DEPTH_TEST);
228*35238bceSAndroid Build Coastguard Worker
229*35238bceSAndroid Build Coastguard Worker // Upper left: two quads with same depth
230*35238bceSAndroid Build Coastguard Worker context.depthFunc(GL_ALWAYS);
231*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, red);
232*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.2f), Vec3(0.0f, 0.0f, 0.2f));
233*35238bceSAndroid Build Coastguard Worker context.depthFunc(m_compareOp);
234*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, green);
235*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.2f), Vec3(0.0f, 0.0f, 0.2f));
236*35238bceSAndroid Build Coastguard Worker
237*35238bceSAndroid Build Coastguard Worker // Lower left: two quads, d1 < d2
238*35238bceSAndroid Build Coastguard Worker context.depthFunc(GL_ALWAYS);
239*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, red);
240*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(-1.0f, 0.0f, -0.4f), Vec3(0.0f, 1.0f, -0.4f));
241*35238bceSAndroid Build Coastguard Worker context.depthFunc(m_compareOp);
242*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, green);
243*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(-1.0f, 0.0f, -0.1f), Vec3(0.0f, 1.0f, -0.1f));
244*35238bceSAndroid Build Coastguard Worker
245*35238bceSAndroid Build Coastguard Worker // Upper right: two quads, d1 > d2
246*35238bceSAndroid Build Coastguard Worker context.depthFunc(GL_ALWAYS);
247*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, red);
248*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(0.0f, -1.0f, 0.5f), Vec3(1.0f, 0.0f, 0.5f));
249*35238bceSAndroid Build Coastguard Worker context.depthFunc(m_compareOp);
250*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, green);
251*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(0.0f, -1.0f, 0.3f), Vec3(1.0f, 0.0f, 0.3f));
252*35238bceSAndroid Build Coastguard Worker
253*35238bceSAndroid Build Coastguard Worker // Lower right: two quads, d1 = 0, d2 = [-1..1]
254*35238bceSAndroid Build Coastguard Worker context.depthFunc(GL_ALWAYS);
255*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, red);
256*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(0.0f, 0.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f));
257*35238bceSAndroid Build Coastguard Worker context.depthFunc(m_compareOp);
258*35238bceSAndroid Build Coastguard Worker shader.setColor(context, shaderID, green);
259*35238bceSAndroid Build Coastguard Worker sglr::drawQuad(context, shaderID, Vec3(0.0f, 0.0f, -1.0f), Vec3(1.0f, 1.0f, 1.0f));
260*35238bceSAndroid Build Coastguard Worker }
261*35238bceSAndroid Build Coastguard Worker
262*35238bceSAndroid Build Coastguard Worker private:
263*35238bceSAndroid Build Coastguard Worker uint32_t m_compareOp;
264*35238bceSAndroid Build Coastguard Worker };
265*35238bceSAndroid Build Coastguard Worker
DepthTests(Context & context)266*35238bceSAndroid Build Coastguard Worker DepthTests::DepthTests(Context &context) : TestCaseGroup(context, "depth", "Depth Tests")
267*35238bceSAndroid Build Coastguard Worker {
268*35238bceSAndroid Build Coastguard Worker }
269*35238bceSAndroid Build Coastguard Worker
~DepthTests(void)270*35238bceSAndroid Build Coastguard Worker DepthTests::~DepthTests(void)
271*35238bceSAndroid Build Coastguard Worker {
272*35238bceSAndroid Build Coastguard Worker }
273*35238bceSAndroid Build Coastguard Worker
init(void)274*35238bceSAndroid Build Coastguard Worker void DepthTests::init(void)
275*35238bceSAndroid Build Coastguard Worker {
276*35238bceSAndroid Build Coastguard Worker addChild(new DepthCompareCase(m_context, "cmp_always", "Always pass depth test", GL_ALWAYS));
277*35238bceSAndroid Build Coastguard Worker addChild(new DepthCompareCase(m_context, "cmp_never", "Never pass depth test", GL_NEVER));
278*35238bceSAndroid Build Coastguard Worker addChild(new DepthCompareCase(m_context, "cmp_equal", "Depth compare: equal", GL_EQUAL));
279*35238bceSAndroid Build Coastguard Worker addChild(new DepthCompareCase(m_context, "cmp_not_equal", "Depth compare: not equal", GL_NOTEQUAL));
280*35238bceSAndroid Build Coastguard Worker addChild(new DepthCompareCase(m_context, "cmp_less_than", "Depth compare: less than", GL_LESS));
281*35238bceSAndroid Build Coastguard Worker addChild(new DepthCompareCase(m_context, "cmp_less_or_equal", "Depth compare: less than or equal", GL_LEQUAL));
282*35238bceSAndroid Build Coastguard Worker addChild(new DepthCompareCase(m_context, "cmp_greater_than", "Depth compare: greater than", GL_GREATER));
283*35238bceSAndroid Build Coastguard Worker addChild(
284*35238bceSAndroid Build Coastguard Worker new DepthCompareCase(m_context, "cmp_greater_or_equal", "Depth compare: greater than or equal", GL_GEQUAL));
285*35238bceSAndroid Build Coastguard Worker }
286*35238bceSAndroid Build Coastguard Worker
287*35238bceSAndroid Build Coastguard Worker } // namespace Functional
288*35238bceSAndroid Build Coastguard Worker } // namespace gles3
289*35238bceSAndroid Build Coastguard Worker } // namespace deqp
290