1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker * drawElements Quality Program OpenGL ES 2.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 Framebuffer Object API Tests.
22*35238bceSAndroid Build Coastguard Worker *
23*35238bceSAndroid Build Coastguard Worker * Notes:
24*35238bceSAndroid Build Coastguard Worker * All gl calls are passed thru sgl2::Context class. Reasons:
25*35238bceSAndroid Build Coastguard Worker * + Name, object allocation is tracked and live resources are freed
26*35238bceSAndroid Build Coastguard Worker * when Context is destroyed.
27*35238bceSAndroid Build Coastguard Worker * + Makes it possible to easily log all relevant calls into test log.
28*35238bceSAndroid Build Coastguard Worker * \todo [pyry] This is not implemented yet
29*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
30*35238bceSAndroid Build Coastguard Worker
31*35238bceSAndroid Build Coastguard Worker #include "es2fFboApiTest.hpp"
32*35238bceSAndroid Build Coastguard Worker #include "sglrGLContext.hpp"
33*35238bceSAndroid Build Coastguard Worker #include "gluDefs.hpp"
34*35238bceSAndroid Build Coastguard Worker #include "gluContextInfo.hpp"
35*35238bceSAndroid Build Coastguard Worker #include "gluStrUtil.hpp"
36*35238bceSAndroid Build Coastguard Worker #include "tcuRenderTarget.hpp"
37*35238bceSAndroid Build Coastguard Worker #include "deString.h"
38*35238bceSAndroid Build Coastguard Worker #include "glwFunctions.hpp"
39*35238bceSAndroid Build Coastguard Worker #include "glsFboUtil.hpp"
40*35238bceSAndroid Build Coastguard Worker #include "glwEnums.hpp"
41*35238bceSAndroid Build Coastguard Worker
42*35238bceSAndroid Build Coastguard Worker #include <iterator>
43*35238bceSAndroid Build Coastguard Worker #include <algorithm>
44*35238bceSAndroid Build Coastguard Worker
45*35238bceSAndroid Build Coastguard Worker namespace deqp
46*35238bceSAndroid Build Coastguard Worker {
47*35238bceSAndroid Build Coastguard Worker namespace gles2
48*35238bceSAndroid Build Coastguard Worker {
49*35238bceSAndroid Build Coastguard Worker namespace Functional
50*35238bceSAndroid Build Coastguard Worker {
51*35238bceSAndroid Build Coastguard Worker
52*35238bceSAndroid Build Coastguard Worker using std::string;
53*35238bceSAndroid Build Coastguard Worker using std::vector;
54*35238bceSAndroid Build Coastguard Worker using tcu::TestLog;
55*35238bceSAndroid Build Coastguard Worker
56*35238bceSAndroid Build Coastguard Worker using glw::GLenum;
57*35238bceSAndroid Build Coastguard Worker using glw::GLint;
58*35238bceSAndroid Build Coastguard Worker
logComment(tcu::TestContext & testCtx,const char * comment)59*35238bceSAndroid Build Coastguard Worker static void logComment(tcu::TestContext &testCtx, const char *comment)
60*35238bceSAndroid Build Coastguard Worker {
61*35238bceSAndroid Build Coastguard Worker testCtx.getLog() << TestLog::Message << "// " << comment << TestLog::EndMessage;
62*35238bceSAndroid Build Coastguard Worker }
63*35238bceSAndroid Build Coastguard Worker
checkError(tcu::TestContext & testCtx,sglr::Context & ctx,GLenum expect)64*35238bceSAndroid Build Coastguard Worker static void checkError(tcu::TestContext &testCtx, sglr::Context &ctx, GLenum expect)
65*35238bceSAndroid Build Coastguard Worker {
66*35238bceSAndroid Build Coastguard Worker GLenum result = ctx.getError();
67*35238bceSAndroid Build Coastguard Worker testCtx.getLog() << TestLog::Message << "// " << (result == expect ? "Pass" : "Fail") << ", expected "
68*35238bceSAndroid Build Coastguard Worker << glu::getErrorStr(expect) << TestLog::EndMessage;
69*35238bceSAndroid Build Coastguard Worker
70*35238bceSAndroid Build Coastguard Worker if (result != expect)
71*35238bceSAndroid Build Coastguard Worker testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error code mismatch");
72*35238bceSAndroid Build Coastguard Worker }
73*35238bceSAndroid Build Coastguard Worker
checkEitherError(tcu::TestContext & testCtx,sglr::Context & ctx,GLenum expectA,GLenum expectB)74*35238bceSAndroid Build Coastguard Worker static void checkEitherError(tcu::TestContext &testCtx, sglr::Context &ctx, GLenum expectA, GLenum expectB)
75*35238bceSAndroid Build Coastguard Worker {
76*35238bceSAndroid Build Coastguard Worker GLenum result = ctx.getError();
77*35238bceSAndroid Build Coastguard Worker bool isOk = (result == expectA || result == expectB);
78*35238bceSAndroid Build Coastguard Worker
79*35238bceSAndroid Build Coastguard Worker testCtx.getLog() << TestLog::Message << "// " << (isOk ? "Pass" : "Fail") << ", expected "
80*35238bceSAndroid Build Coastguard Worker << glu::getErrorStr(expectA) << " or " << glu::getErrorStr(expectB) << TestLog::EndMessage;
81*35238bceSAndroid Build Coastguard Worker
82*35238bceSAndroid Build Coastguard Worker if (!isOk)
83*35238bceSAndroid Build Coastguard Worker testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error code mismatch");
84*35238bceSAndroid Build Coastguard Worker }
85*35238bceSAndroid Build Coastguard Worker
getAttachmentName(GLenum attachment)86*35238bceSAndroid Build Coastguard Worker static const char *getAttachmentName(GLenum attachment)
87*35238bceSAndroid Build Coastguard Worker {
88*35238bceSAndroid Build Coastguard Worker switch (attachment)
89*35238bceSAndroid Build Coastguard Worker {
90*35238bceSAndroid Build Coastguard Worker case GL_COLOR_ATTACHMENT0:
91*35238bceSAndroid Build Coastguard Worker return "GL_COLOR_ATTACHMENT0";
92*35238bceSAndroid Build Coastguard Worker case GL_DEPTH_ATTACHMENT:
93*35238bceSAndroid Build Coastguard Worker return "GL_DEPTH_ATTACHMENT";
94*35238bceSAndroid Build Coastguard Worker case GL_STENCIL_ATTACHMENT:
95*35238bceSAndroid Build Coastguard Worker return "GL_STENCIL_ATTACHMENT";
96*35238bceSAndroid Build Coastguard Worker default:
97*35238bceSAndroid Build Coastguard Worker throw tcu::InternalError("Unknown attachment", "", __FILE__, __LINE__);
98*35238bceSAndroid Build Coastguard Worker }
99*35238bceSAndroid Build Coastguard Worker }
100*35238bceSAndroid Build Coastguard Worker
getAttachmentParameterName(GLenum pname)101*35238bceSAndroid Build Coastguard Worker static const char *getAttachmentParameterName(GLenum pname)
102*35238bceSAndroid Build Coastguard Worker {
103*35238bceSAndroid Build Coastguard Worker switch (pname)
104*35238bceSAndroid Build Coastguard Worker {
105*35238bceSAndroid Build Coastguard Worker case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
106*35238bceSAndroid Build Coastguard Worker return "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE";
107*35238bceSAndroid Build Coastguard Worker case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
108*35238bceSAndroid Build Coastguard Worker return "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME";
109*35238bceSAndroid Build Coastguard Worker case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
110*35238bceSAndroid Build Coastguard Worker return "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL";
111*35238bceSAndroid Build Coastguard Worker case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
112*35238bceSAndroid Build Coastguard Worker return "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE";
113*35238bceSAndroid Build Coastguard Worker default:
114*35238bceSAndroid Build Coastguard Worker throw tcu::InternalError("Unknown parameter", "", __FILE__, __LINE__);
115*35238bceSAndroid Build Coastguard Worker }
116*35238bceSAndroid Build Coastguard Worker }
117*35238bceSAndroid Build Coastguard Worker
getAttachmentParameterValueName(GLint value)118*35238bceSAndroid Build Coastguard Worker static string getAttachmentParameterValueName(GLint value)
119*35238bceSAndroid Build Coastguard Worker {
120*35238bceSAndroid Build Coastguard Worker switch (value)
121*35238bceSAndroid Build Coastguard Worker {
122*35238bceSAndroid Build Coastguard Worker case 0:
123*35238bceSAndroid Build Coastguard Worker return "GL_NONE(0)";
124*35238bceSAndroid Build Coastguard Worker case GL_TEXTURE:
125*35238bceSAndroid Build Coastguard Worker return "GL_TEXTURE";
126*35238bceSAndroid Build Coastguard Worker case GL_RENDERBUFFER:
127*35238bceSAndroid Build Coastguard Worker return "GL_RENDERBUFFER";
128*35238bceSAndroid Build Coastguard Worker case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
129*35238bceSAndroid Build Coastguard Worker return "GL_TEXTURE_CUBE_MAP_POSITIVE_X";
130*35238bceSAndroid Build Coastguard Worker case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
131*35238bceSAndroid Build Coastguard Worker return "GL_TEXTURE_CUBE_MAP_NEGATIVE_X";
132*35238bceSAndroid Build Coastguard Worker case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
133*35238bceSAndroid Build Coastguard Worker return "GL_TEXTURE_CUBE_MAP_POSITIVE_Y";
134*35238bceSAndroid Build Coastguard Worker case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
135*35238bceSAndroid Build Coastguard Worker return "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y";
136*35238bceSAndroid Build Coastguard Worker case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
137*35238bceSAndroid Build Coastguard Worker return "GL_TEXTURE_CUBE_MAP_POSITIVE_Z";
138*35238bceSAndroid Build Coastguard Worker case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
139*35238bceSAndroid Build Coastguard Worker return "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z";
140*35238bceSAndroid Build Coastguard Worker default:
141*35238bceSAndroid Build Coastguard Worker {
142*35238bceSAndroid Build Coastguard Worker char tmp[64];
143*35238bceSAndroid Build Coastguard Worker deSprintf(tmp, sizeof(tmp), "0x%x", value);
144*35238bceSAndroid Build Coastguard Worker return string(tmp);
145*35238bceSAndroid Build Coastguard Worker }
146*35238bceSAndroid Build Coastguard Worker }
147*35238bceSAndroid Build Coastguard Worker }
148*35238bceSAndroid Build Coastguard Worker
checkFboAttachmentParam(tcu::TestContext & testCtx,sglr::Context & ctx,GLenum attachment,GLenum pname,GLint expectedValue)149*35238bceSAndroid Build Coastguard Worker static void checkFboAttachmentParam(tcu::TestContext &testCtx, sglr::Context &ctx, GLenum attachment, GLenum pname,
150*35238bceSAndroid Build Coastguard Worker GLint expectedValue)
151*35238bceSAndroid Build Coastguard Worker {
152*35238bceSAndroid Build Coastguard Worker TestLog &log = testCtx.getLog();
153*35238bceSAndroid Build Coastguard Worker log << TestLog::Message << "// Querying " << getAttachmentName(attachment) << " "
154*35238bceSAndroid Build Coastguard Worker << getAttachmentParameterName(pname) << TestLog::EndMessage;
155*35238bceSAndroid Build Coastguard Worker
156*35238bceSAndroid Build Coastguard Worker GLint value = 0xcdcdcdcd;
157*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, attachment, pname, &value);
158*35238bceSAndroid Build Coastguard Worker
159*35238bceSAndroid Build Coastguard Worker GLenum err = ctx.getError();
160*35238bceSAndroid Build Coastguard Worker
161*35238bceSAndroid Build Coastguard Worker if (value == expectedValue && err == GL_NO_ERROR)
162*35238bceSAndroid Build Coastguard Worker log << TestLog::Message << "// Pass" << TestLog::EndMessage;
163*35238bceSAndroid Build Coastguard Worker else
164*35238bceSAndroid Build Coastguard Worker {
165*35238bceSAndroid Build Coastguard Worker log << TestLog::Message << "// Fail, expected " << getAttachmentParameterValueName(expectedValue)
166*35238bceSAndroid Build Coastguard Worker << " without error" << TestLog::EndMessage;
167*35238bceSAndroid Build Coastguard Worker testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid result for attachment param query");
168*35238bceSAndroid Build Coastguard Worker }
169*35238bceSAndroid Build Coastguard Worker }
170*35238bceSAndroid Build Coastguard Worker
notSupportedTest(tcu::TestContext & testCtx,sglr::Context & context)171*35238bceSAndroid Build Coastguard Worker static void notSupportedTest(tcu::TestContext &testCtx, sglr::Context &context)
172*35238bceSAndroid Build Coastguard Worker {
173*35238bceSAndroid Build Coastguard Worker DE_UNREF(testCtx);
174*35238bceSAndroid Build Coastguard Worker DE_UNREF(context);
175*35238bceSAndroid Build Coastguard Worker throw tcu::NotSupportedError("Not supported", "", __FILE__, __LINE__);
176*35238bceSAndroid Build Coastguard Worker }
177*35238bceSAndroid Build Coastguard Worker
textureLevelsTest(tcu::TestContext & testCtx,sglr::Context & context)178*35238bceSAndroid Build Coastguard Worker static void textureLevelsTest(tcu::TestContext &testCtx, sglr::Context &context)
179*35238bceSAndroid Build Coastguard Worker {
180*35238bceSAndroid Build Coastguard Worker uint32_t tex = 1;
181*35238bceSAndroid Build Coastguard Worker uint32_t fbo = 1;
182*35238bceSAndroid Build Coastguard Worker
183*35238bceSAndroid Build Coastguard Worker context.bindTexture(GL_TEXTURE_2D, tex);
184*35238bceSAndroid Build Coastguard Worker context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, 256);
185*35238bceSAndroid Build Coastguard Worker context.texImage2D(GL_TEXTURE_2D, 1, GL_RGB, 128, 128);
186*35238bceSAndroid Build Coastguard Worker
187*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, fbo);
188*35238bceSAndroid Build Coastguard Worker
189*35238bceSAndroid Build Coastguard Worker static int levels[] = {2, 1, 0, -1, 0x7fffffff, 0, 1};
190*35238bceSAndroid Build Coastguard Worker
191*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(levels); ndx++)
192*35238bceSAndroid Build Coastguard Worker {
193*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, levels[ndx]);
194*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, levels[ndx] == 0 ? GL_NO_ERROR : GL_INVALID_VALUE);
195*35238bceSAndroid Build Coastguard Worker }
196*35238bceSAndroid Build Coastguard Worker }
197*35238bceSAndroid Build Coastguard Worker
textureLevelsWithRenderToMipmapTest(tcu::TestContext & testCtx,sglr::Context & context)198*35238bceSAndroid Build Coastguard Worker static void textureLevelsWithRenderToMipmapTest(tcu::TestContext &testCtx, sglr::Context &context)
199*35238bceSAndroid Build Coastguard Worker {
200*35238bceSAndroid Build Coastguard Worker uint32_t tex = 1;
201*35238bceSAndroid Build Coastguard Worker uint32_t fbo = 1;
202*35238bceSAndroid Build Coastguard Worker
203*35238bceSAndroid Build Coastguard Worker context.bindTexture(GL_TEXTURE_2D, tex);
204*35238bceSAndroid Build Coastguard Worker context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, 256);
205*35238bceSAndroid Build Coastguard Worker context.texImage2D(GL_TEXTURE_2D, 1, GL_RGB, 128, 128);
206*35238bceSAndroid Build Coastguard Worker
207*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, fbo);
208*35238bceSAndroid Build Coastguard Worker
209*35238bceSAndroid Build Coastguard Worker static int levels[] = {2, 1, 0, -1, 0x7fffffff, 0, 1};
210*35238bceSAndroid Build Coastguard Worker
211*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(levels); ndx++)
212*35238bceSAndroid Build Coastguard Worker {
213*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, levels[ndx]);
214*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, de::inBounds(levels[ndx], 0, 16) ? GL_NO_ERROR : GL_INVALID_VALUE);
215*35238bceSAndroid Build Coastguard Worker }
216*35238bceSAndroid Build Coastguard Worker }
217*35238bceSAndroid Build Coastguard Worker
validTex2DAttachmentsTest(tcu::TestContext & testCtx,sglr::Context & context)218*35238bceSAndroid Build Coastguard Worker static void validTex2DAttachmentsTest(tcu::TestContext &testCtx, sglr::Context &context)
219*35238bceSAndroid Build Coastguard Worker {
220*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, 1);
221*35238bceSAndroid Build Coastguard Worker static const GLenum attachmentPoints[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
222*35238bceSAndroid Build Coastguard Worker
223*35238bceSAndroid Build Coastguard Worker // Texture2D
224*35238bceSAndroid Build Coastguard Worker uint32_t tex2D = 1;
225*35238bceSAndroid Build Coastguard Worker context.bindTexture(GL_TEXTURE_2D, tex2D);
226*35238bceSAndroid Build Coastguard Worker for (int pointNdx = 0; pointNdx < DE_LENGTH_OF_ARRAY(attachmentPoints); pointNdx++)
227*35238bceSAndroid Build Coastguard Worker {
228*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoints[pointNdx], GL_TEXTURE_2D, tex2D, 0);
229*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_NO_ERROR);
230*35238bceSAndroid Build Coastguard Worker }
231*35238bceSAndroid Build Coastguard Worker }
232*35238bceSAndroid Build Coastguard Worker
validTexCubeAttachmentsTest(tcu::TestContext & testCtx,sglr::Context & context)233*35238bceSAndroid Build Coastguard Worker static void validTexCubeAttachmentsTest(tcu::TestContext &testCtx, sglr::Context &context)
234*35238bceSAndroid Build Coastguard Worker {
235*35238bceSAndroid Build Coastguard Worker static const GLenum attachmentPoints[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
236*35238bceSAndroid Build Coastguard Worker static const GLenum cubeTargets[] = {GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
237*35238bceSAndroid Build Coastguard Worker GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
238*35238bceSAndroid Build Coastguard Worker GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z};
239*35238bceSAndroid Build Coastguard Worker
240*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, 1);
241*35238bceSAndroid Build Coastguard Worker
242*35238bceSAndroid Build Coastguard Worker // TextureCube
243*35238bceSAndroid Build Coastguard Worker uint32_t texCube = 2;
244*35238bceSAndroid Build Coastguard Worker context.bindTexture(GL_TEXTURE_CUBE_MAP, texCube);
245*35238bceSAndroid Build Coastguard Worker for (int pointNdx = 0; pointNdx < DE_LENGTH_OF_ARRAY(attachmentPoints); pointNdx++)
246*35238bceSAndroid Build Coastguard Worker {
247*35238bceSAndroid Build Coastguard Worker for (int targetNdx = 0; targetNdx < DE_LENGTH_OF_ARRAY(cubeTargets); targetNdx++)
248*35238bceSAndroid Build Coastguard Worker {
249*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoints[pointNdx], cubeTargets[targetNdx], texCube,
250*35238bceSAndroid Build Coastguard Worker 0);
251*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_NO_ERROR);
252*35238bceSAndroid Build Coastguard Worker }
253*35238bceSAndroid Build Coastguard Worker }
254*35238bceSAndroid Build Coastguard Worker }
255*35238bceSAndroid Build Coastguard Worker
validRboAttachmentsTest(tcu::TestContext & testCtx,sglr::Context & context)256*35238bceSAndroid Build Coastguard Worker static void validRboAttachmentsTest(tcu::TestContext &testCtx, sglr::Context &context)
257*35238bceSAndroid Build Coastguard Worker {
258*35238bceSAndroid Build Coastguard Worker static const GLenum attachmentPoints[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
259*35238bceSAndroid Build Coastguard Worker
260*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, 1);
261*35238bceSAndroid Build Coastguard Worker
262*35238bceSAndroid Build Coastguard Worker // Renderbuffer
263*35238bceSAndroid Build Coastguard Worker uint32_t rbo = 3;
264*35238bceSAndroid Build Coastguard Worker context.bindRenderbuffer(GL_RENDERBUFFER, rbo);
265*35238bceSAndroid Build Coastguard Worker for (int pointNdx = 0; pointNdx < DE_LENGTH_OF_ARRAY(attachmentPoints); pointNdx++)
266*35238bceSAndroid Build Coastguard Worker {
267*35238bceSAndroid Build Coastguard Worker context.framebufferRenderbuffer(GL_FRAMEBUFFER, attachmentPoints[pointNdx], GL_RENDERBUFFER, rbo);
268*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_NO_ERROR);
269*35238bceSAndroid Build Coastguard Worker }
270*35238bceSAndroid Build Coastguard Worker }
271*35238bceSAndroid Build Coastguard Worker
attachToDefaultFramebufferTest(tcu::TestContext & testCtx,sglr::Context & context)272*35238bceSAndroid Build Coastguard Worker static void attachToDefaultFramebufferTest(tcu::TestContext &testCtx, sglr::Context &context)
273*35238bceSAndroid Build Coastguard Worker {
274*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching 2D texture to default framebuffer");
275*35238bceSAndroid Build Coastguard Worker
276*35238bceSAndroid Build Coastguard Worker uint32_t tex2D = 1;
277*35238bceSAndroid Build Coastguard Worker context.bindTexture(GL_TEXTURE_2D, tex2D);
278*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, 0);
279*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
280*35238bceSAndroid Build Coastguard Worker
281*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching renderbuffer to default framebuffer");
282*35238bceSAndroid Build Coastguard Worker
283*35238bceSAndroid Build Coastguard Worker uint32_t rbo = 1;
284*35238bceSAndroid Build Coastguard Worker context.bindRenderbuffer(GL_RENDERBUFFER, rbo);
285*35238bceSAndroid Build Coastguard Worker context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rbo);
286*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
287*35238bceSAndroid Build Coastguard Worker }
288*35238bceSAndroid Build Coastguard Worker
invalidTex2DAttachmentTest(tcu::TestContext & testCtx,sglr::Context & context)289*35238bceSAndroid Build Coastguard Worker static void invalidTex2DAttachmentTest(tcu::TestContext &testCtx, sglr::Context &context)
290*35238bceSAndroid Build Coastguard Worker {
291*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, 1);
292*35238bceSAndroid Build Coastguard Worker
293*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching 2D texture using GL_TEXTURE_CUBE_MAP_NEGATIVE_X texture target");
294*35238bceSAndroid Build Coastguard Worker
295*35238bceSAndroid Build Coastguard Worker uint32_t tex2D = 1;
296*35238bceSAndroid Build Coastguard Worker context.bindTexture(GL_TEXTURE_2D, tex2D);
297*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, tex2D, 0);
298*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
299*35238bceSAndroid Build Coastguard Worker
300*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching deleted 2D texture object");
301*35238bceSAndroid Build Coastguard Worker context.deleteTextures(1, &tex2D);
302*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, 0);
303*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
304*35238bceSAndroid Build Coastguard Worker }
305*35238bceSAndroid Build Coastguard Worker
invalidTexCubeAttachmentTest(tcu::TestContext & testCtx,sglr::Context & context)306*35238bceSAndroid Build Coastguard Worker static void invalidTexCubeAttachmentTest(tcu::TestContext &testCtx, sglr::Context &context)
307*35238bceSAndroid Build Coastguard Worker {
308*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, 1);
309*35238bceSAndroid Build Coastguard Worker
310*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching cube texture using GL_TEXTURE_2D texture target");
311*35238bceSAndroid Build Coastguard Worker uint32_t texCube = 2;
312*35238bceSAndroid Build Coastguard Worker context.bindTexture(GL_TEXTURE_CUBE_MAP, texCube);
313*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texCube, 0);
314*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
315*35238bceSAndroid Build Coastguard Worker
316*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching deleted cube texture object");
317*35238bceSAndroid Build Coastguard Worker context.deleteTextures(1, &texCube);
318*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, texCube, 0);
319*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
320*35238bceSAndroid Build Coastguard Worker }
321*35238bceSAndroid Build Coastguard Worker
invalidRboAttachmentTest(tcu::TestContext & testCtx,sglr::Context & context)322*35238bceSAndroid Build Coastguard Worker static void invalidRboAttachmentTest(tcu::TestContext &testCtx, sglr::Context &context)
323*35238bceSAndroid Build Coastguard Worker {
324*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, 1);
325*35238bceSAndroid Build Coastguard Worker
326*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching renderbuffer using GL_FRAMEBUFFER renderbuffer target");
327*35238bceSAndroid Build Coastguard Worker uint32_t rbo = 3;
328*35238bceSAndroid Build Coastguard Worker context.bindRenderbuffer(GL_RENDERBUFFER, rbo);
329*35238bceSAndroid Build Coastguard Worker context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER, rbo);
330*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_ENUM);
331*35238bceSAndroid Build Coastguard Worker
332*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching deleted renderbuffer object");
333*35238bceSAndroid Build Coastguard Worker context.deleteRenderbuffers(1, &rbo);
334*35238bceSAndroid Build Coastguard Worker context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
335*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
336*35238bceSAndroid Build Coastguard Worker }
337*35238bceSAndroid Build Coastguard Worker
attachNamesTest(tcu::TestContext & testCtx,sglr::Context & context)338*35238bceSAndroid Build Coastguard Worker static void attachNamesTest(tcu::TestContext &testCtx, sglr::Context &context)
339*35238bceSAndroid Build Coastguard Worker {
340*35238bceSAndroid Build Coastguard Worker context.bindFramebuffer(GL_FRAMEBUFFER, 1);
341*35238bceSAndroid Build Coastguard Worker
342*35238bceSAndroid Build Coastguard Worker // Just allocate some names, don't bind for storage
343*35238bceSAndroid Build Coastguard Worker uint32_t reservedTexName;
344*35238bceSAndroid Build Coastguard Worker context.genTextures(1, &reservedTexName);
345*35238bceSAndroid Build Coastguard Worker
346*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching allocated texture name to 2D target");
347*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, reservedTexName, 0);
348*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
349*35238bceSAndroid Build Coastguard Worker
350*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching allocated texture name to cube target");
351*35238bceSAndroid Build Coastguard Worker context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, reservedTexName,
352*35238bceSAndroid Build Coastguard Worker 0);
353*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
354*35238bceSAndroid Build Coastguard Worker
355*35238bceSAndroid Build Coastguard Worker uint32_t reservedRboName;
356*35238bceSAndroid Build Coastguard Worker context.genRenderbuffers(1, &reservedRboName);
357*35238bceSAndroid Build Coastguard Worker
358*35238bceSAndroid Build Coastguard Worker logComment(testCtx, "Attaching allocated renderbuffer name");
359*35238bceSAndroid Build Coastguard Worker context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, reservedRboName);
360*35238bceSAndroid Build Coastguard Worker checkError(testCtx, context, GL_INVALID_OPERATION);
361*35238bceSAndroid Build Coastguard Worker }
362*35238bceSAndroid Build Coastguard Worker
attachmentQueryDefaultFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)363*35238bceSAndroid Build Coastguard Worker static void attachmentQueryDefaultFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
364*35238bceSAndroid Build Coastguard Worker {
365*35238bceSAndroid Build Coastguard Worker // Check that proper error codes are returned
366*35238bceSAndroid Build Coastguard Worker GLint unused = 1;
367*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
368*35238bceSAndroid Build Coastguard Worker &unused);
369*35238bceSAndroid Build Coastguard Worker checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
370*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
371*35238bceSAndroid Build Coastguard Worker &unused);
372*35238bceSAndroid Build Coastguard Worker checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
373*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
374*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, &unused);
375*35238bceSAndroid Build Coastguard Worker checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
376*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
377*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, &unused);
378*35238bceSAndroid Build Coastguard Worker checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
379*35238bceSAndroid Build Coastguard Worker }
380*35238bceSAndroid Build Coastguard Worker
attachmentQueryEmptyFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)381*35238bceSAndroid Build Coastguard Worker static void attachmentQueryEmptyFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
382*35238bceSAndroid Build Coastguard Worker {
383*35238bceSAndroid Build Coastguard Worker static const GLenum attachmentPoints[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
384*35238bceSAndroid Build Coastguard Worker
385*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
386*35238bceSAndroid Build Coastguard Worker
387*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(attachmentPoints); ndx++)
388*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, attachmentPoints[ndx], GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
389*35238bceSAndroid Build Coastguard Worker
390*35238bceSAndroid Build Coastguard Worker // Check that proper error codes are returned
391*35238bceSAndroid Build Coastguard Worker GLint unused = -1;
392*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
393*35238bceSAndroid Build Coastguard Worker &unused);
394*35238bceSAndroid Build Coastguard Worker checkError(testCtx, ctx, GL_INVALID_ENUM);
395*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
396*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, &unused);
397*35238bceSAndroid Build Coastguard Worker checkError(testCtx, ctx, GL_INVALID_ENUM);
398*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
399*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, &unused);
400*35238bceSAndroid Build Coastguard Worker checkError(testCtx, ctx, GL_INVALID_ENUM);
401*35238bceSAndroid Build Coastguard Worker }
402*35238bceSAndroid Build Coastguard Worker
es3AttachmentQueryEmptyFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)403*35238bceSAndroid Build Coastguard Worker static void es3AttachmentQueryEmptyFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
404*35238bceSAndroid Build Coastguard Worker {
405*35238bceSAndroid Build Coastguard Worker // Error codes changed for ES3 so this version of test should be
406*35238bceSAndroid Build Coastguard Worker // used when ES2 context is created on ES3 capable hardwere
407*35238bceSAndroid Build Coastguard Worker
408*35238bceSAndroid Build Coastguard Worker static const GLenum attachmentPoints[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
409*35238bceSAndroid Build Coastguard Worker
410*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
411*35238bceSAndroid Build Coastguard Worker
412*35238bceSAndroid Build Coastguard Worker for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(attachmentPoints); ndx++)
413*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, attachmentPoints[ndx], GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
414*35238bceSAndroid Build Coastguard Worker
415*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 0);
416*35238bceSAndroid Build Coastguard Worker
417*35238bceSAndroid Build Coastguard Worker // Check that proper error codes are returned
418*35238bceSAndroid Build Coastguard Worker GLint unused = -1;
419*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
420*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, &unused);
421*35238bceSAndroid Build Coastguard Worker checkError(testCtx, ctx, GL_INVALID_OPERATION);
422*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
423*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, &unused);
424*35238bceSAndroid Build Coastguard Worker checkError(testCtx, ctx, GL_INVALID_OPERATION);
425*35238bceSAndroid Build Coastguard Worker }
426*35238bceSAndroid Build Coastguard Worker
attachmentQueryTex2DTest(tcu::TestContext & testCtx,sglr::Context & ctx)427*35238bceSAndroid Build Coastguard Worker static void attachmentQueryTex2DTest(tcu::TestContext &testCtx, sglr::Context &ctx)
428*35238bceSAndroid Build Coastguard Worker {
429*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
430*35238bceSAndroid Build Coastguard Worker
431*35238bceSAndroid Build Coastguard Worker ctx.bindTexture(GL_TEXTURE_2D, 1);
432*35238bceSAndroid Build Coastguard Worker ctx.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 1, 0);
433*35238bceSAndroid Build Coastguard Worker
434*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
435*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 1);
436*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, 0);
437*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, 0);
438*35238bceSAndroid Build Coastguard Worker }
439*35238bceSAndroid Build Coastguard Worker
attachmentQueryTexCubeTest(tcu::TestContext & testCtx,sglr::Context & ctx)440*35238bceSAndroid Build Coastguard Worker static void attachmentQueryTexCubeTest(tcu::TestContext &testCtx, sglr::Context &ctx)
441*35238bceSAndroid Build Coastguard Worker {
442*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
443*35238bceSAndroid Build Coastguard Worker
444*35238bceSAndroid Build Coastguard Worker ctx.bindTexture(GL_TEXTURE_CUBE_MAP, 2);
445*35238bceSAndroid Build Coastguard Worker ctx.framebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 2, 0);
446*35238bceSAndroid Build Coastguard Worker
447*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
448*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 2);
449*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, 0);
450*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE,
451*35238bceSAndroid Build Coastguard Worker GL_TEXTURE_CUBE_MAP_NEGATIVE_Y);
452*35238bceSAndroid Build Coastguard Worker }
453*35238bceSAndroid Build Coastguard Worker
attachmentQueryRboTest(tcu::TestContext & testCtx,sglr::Context & ctx)454*35238bceSAndroid Build Coastguard Worker static void attachmentQueryRboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
455*35238bceSAndroid Build Coastguard Worker {
456*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
457*35238bceSAndroid Build Coastguard Worker
458*35238bceSAndroid Build Coastguard Worker ctx.bindRenderbuffer(GL_RENDERBUFFER, 3);
459*35238bceSAndroid Build Coastguard Worker ctx.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 3);
460*35238bceSAndroid Build Coastguard Worker
461*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
462*35238bceSAndroid Build Coastguard Worker GL_RENDERBUFFER);
463*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 3);
464*35238bceSAndroid Build Coastguard Worker
465*35238bceSAndroid Build Coastguard Worker GLint unused = 0;
466*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
467*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, &unused);
468*35238bceSAndroid Build Coastguard Worker checkError(testCtx, ctx, GL_INVALID_ENUM);
469*35238bceSAndroid Build Coastguard Worker ctx.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
470*35238bceSAndroid Build Coastguard Worker GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, &unused);
471*35238bceSAndroid Build Coastguard Worker checkError(testCtx, ctx, GL_INVALID_ENUM);
472*35238bceSAndroid Build Coastguard Worker }
473*35238bceSAndroid Build Coastguard Worker
deleteTex2DAttachedToBoundFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)474*35238bceSAndroid Build Coastguard Worker static void deleteTex2DAttachedToBoundFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
475*35238bceSAndroid Build Coastguard Worker {
476*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
477*35238bceSAndroid Build Coastguard Worker
478*35238bceSAndroid Build Coastguard Worker uint32_t tex2D = 1;
479*35238bceSAndroid Build Coastguard Worker ctx.bindTexture(GL_TEXTURE_2D, tex2D);
480*35238bceSAndroid Build Coastguard Worker ctx.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, 0);
481*35238bceSAndroid Build Coastguard Worker
482*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
483*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
484*35238bceSAndroid Build Coastguard Worker
485*35238bceSAndroid Build Coastguard Worker ctx.deleteTextures(1, &tex2D);
486*35238bceSAndroid Build Coastguard Worker
487*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
488*35238bceSAndroid Build Coastguard Worker }
489*35238bceSAndroid Build Coastguard Worker
deleteTexCubeAttachedToBoundFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)490*35238bceSAndroid Build Coastguard Worker static void deleteTexCubeAttachedToBoundFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
491*35238bceSAndroid Build Coastguard Worker {
492*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
493*35238bceSAndroid Build Coastguard Worker
494*35238bceSAndroid Build Coastguard Worker uint32_t texCube = 1;
495*35238bceSAndroid Build Coastguard Worker ctx.bindTexture(GL_TEXTURE_CUBE_MAP, texCube);
496*35238bceSAndroid Build Coastguard Worker ctx.framebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X, texCube, 0);
497*35238bceSAndroid Build Coastguard Worker
498*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
499*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
500*35238bceSAndroid Build Coastguard Worker
501*35238bceSAndroid Build Coastguard Worker ctx.deleteTextures(1, &texCube);
502*35238bceSAndroid Build Coastguard Worker
503*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
504*35238bceSAndroid Build Coastguard Worker }
505*35238bceSAndroid Build Coastguard Worker
deleteRboAttachedToBoundFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)506*35238bceSAndroid Build Coastguard Worker static void deleteRboAttachedToBoundFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
507*35238bceSAndroid Build Coastguard Worker {
508*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
509*35238bceSAndroid Build Coastguard Worker
510*35238bceSAndroid Build Coastguard Worker uint32_t rbo = 1;
511*35238bceSAndroid Build Coastguard Worker ctx.bindRenderbuffer(GL_RENDERBUFFER, rbo);
512*35238bceSAndroid Build Coastguard Worker ctx.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
513*35238bceSAndroid Build Coastguard Worker
514*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
515*35238bceSAndroid Build Coastguard Worker GL_RENDERBUFFER);
516*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
517*35238bceSAndroid Build Coastguard Worker
518*35238bceSAndroid Build Coastguard Worker ctx.deleteRenderbuffers(1, &rbo);
519*35238bceSAndroid Build Coastguard Worker
520*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
521*35238bceSAndroid Build Coastguard Worker }
522*35238bceSAndroid Build Coastguard Worker
deleteTex2DAttachedToNotBoundFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)523*35238bceSAndroid Build Coastguard Worker static void deleteTex2DAttachedToNotBoundFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
524*35238bceSAndroid Build Coastguard Worker {
525*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
526*35238bceSAndroid Build Coastguard Worker
527*35238bceSAndroid Build Coastguard Worker uint32_t tex2D = 1;
528*35238bceSAndroid Build Coastguard Worker ctx.bindTexture(GL_TEXTURE_2D, tex2D);
529*35238bceSAndroid Build Coastguard Worker ctx.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, 0);
530*35238bceSAndroid Build Coastguard Worker
531*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
532*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
533*35238bceSAndroid Build Coastguard Worker
534*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 0);
535*35238bceSAndroid Build Coastguard Worker
536*35238bceSAndroid Build Coastguard Worker ctx.deleteTextures(1, &tex2D);
537*35238bceSAndroid Build Coastguard Worker
538*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
539*35238bceSAndroid Build Coastguard Worker
540*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
541*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
542*35238bceSAndroid Build Coastguard Worker }
543*35238bceSAndroid Build Coastguard Worker
deleteTexCubeAttachedToNotBoundFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)544*35238bceSAndroid Build Coastguard Worker static void deleteTexCubeAttachedToNotBoundFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
545*35238bceSAndroid Build Coastguard Worker {
546*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
547*35238bceSAndroid Build Coastguard Worker
548*35238bceSAndroid Build Coastguard Worker uint32_t texCube = 1;
549*35238bceSAndroid Build Coastguard Worker ctx.bindTexture(GL_TEXTURE_CUBE_MAP, texCube);
550*35238bceSAndroid Build Coastguard Worker ctx.framebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X, texCube, 0);
551*35238bceSAndroid Build Coastguard Worker
552*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
553*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
554*35238bceSAndroid Build Coastguard Worker
555*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 0);
556*35238bceSAndroid Build Coastguard Worker
557*35238bceSAndroid Build Coastguard Worker ctx.deleteTextures(1, &texCube);
558*35238bceSAndroid Build Coastguard Worker
559*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
560*35238bceSAndroid Build Coastguard Worker
561*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
562*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
563*35238bceSAndroid Build Coastguard Worker }
564*35238bceSAndroid Build Coastguard Worker
deleteRboAttachedToNotBoundFboTest(tcu::TestContext & testCtx,sglr::Context & ctx)565*35238bceSAndroid Build Coastguard Worker static void deleteRboAttachedToNotBoundFboTest(tcu::TestContext &testCtx, sglr::Context &ctx)
566*35238bceSAndroid Build Coastguard Worker {
567*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
568*35238bceSAndroid Build Coastguard Worker
569*35238bceSAndroid Build Coastguard Worker uint32_t rbo = 1;
570*35238bceSAndroid Build Coastguard Worker ctx.bindRenderbuffer(GL_RENDERBUFFER, rbo);
571*35238bceSAndroid Build Coastguard Worker ctx.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
572*35238bceSAndroid Build Coastguard Worker
573*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
574*35238bceSAndroid Build Coastguard Worker GL_RENDERBUFFER);
575*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
576*35238bceSAndroid Build Coastguard Worker
577*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 0);
578*35238bceSAndroid Build Coastguard Worker
579*35238bceSAndroid Build Coastguard Worker ctx.deleteRenderbuffers(1, &rbo);
580*35238bceSAndroid Build Coastguard Worker
581*35238bceSAndroid Build Coastguard Worker ctx.bindFramebuffer(GL_FRAMEBUFFER, 1);
582*35238bceSAndroid Build Coastguard Worker
583*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
584*35238bceSAndroid Build Coastguard Worker GL_RENDERBUFFER);
585*35238bceSAndroid Build Coastguard Worker checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
586*35238bceSAndroid Build Coastguard Worker }
587*35238bceSAndroid Build Coastguard Worker
588*35238bceSAndroid Build Coastguard Worker class FboApiCase : public TestCase
589*35238bceSAndroid Build Coastguard Worker {
590*35238bceSAndroid Build Coastguard Worker public:
591*35238bceSAndroid Build Coastguard Worker typedef void (*TestFunc)(tcu::TestContext &testCtx, sglr::Context &context);
592*35238bceSAndroid Build Coastguard Worker
593*35238bceSAndroid Build Coastguard Worker FboApiCase(Context &context, const char *name, const char *description, TestFunc test);
594*35238bceSAndroid Build Coastguard Worker virtual ~FboApiCase(void);
595*35238bceSAndroid Build Coastguard Worker
596*35238bceSAndroid Build Coastguard Worker virtual IterateResult iterate(void);
597*35238bceSAndroid Build Coastguard Worker
598*35238bceSAndroid Build Coastguard Worker private:
599*35238bceSAndroid Build Coastguard Worker FboApiCase(const FboApiCase &other);
600*35238bceSAndroid Build Coastguard Worker FboApiCase &operator=(const FboApiCase &other);
601*35238bceSAndroid Build Coastguard Worker
602*35238bceSAndroid Build Coastguard Worker TestFunc m_testFunc;
603*35238bceSAndroid Build Coastguard Worker };
604*35238bceSAndroid Build Coastguard Worker
FboApiCase(Context & context,const char * name,const char * description,TestFunc test)605*35238bceSAndroid Build Coastguard Worker FboApiCase::FboApiCase(Context &context, const char *name, const char *description, TestFunc test)
606*35238bceSAndroid Build Coastguard Worker : TestCase(context, name, description)
607*35238bceSAndroid Build Coastguard Worker , m_testFunc(test)
608*35238bceSAndroid Build Coastguard Worker {
609*35238bceSAndroid Build Coastguard Worker }
610*35238bceSAndroid Build Coastguard Worker
~FboApiCase(void)611*35238bceSAndroid Build Coastguard Worker FboApiCase::~FboApiCase(void)
612*35238bceSAndroid Build Coastguard Worker {
613*35238bceSAndroid Build Coastguard Worker }
614*35238bceSAndroid Build Coastguard Worker
iterate(void)615*35238bceSAndroid Build Coastguard Worker TestCase::IterateResult FboApiCase::iterate(void)
616*35238bceSAndroid Build Coastguard Worker {
617*35238bceSAndroid Build Coastguard Worker const glw::Functions &gl = m_context.getRenderContext().getFunctions();
618*35238bceSAndroid Build Coastguard Worker
619*35238bceSAndroid Build Coastguard Worker GLU_EXPECT_NO_ERROR(gl.getError(), "Before test case");
620*35238bceSAndroid Build Coastguard Worker
621*35238bceSAndroid Build Coastguard Worker // Initialize result to PASS
622*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
623*35238bceSAndroid Build Coastguard Worker
624*35238bceSAndroid Build Coastguard Worker // Execute test case
625*35238bceSAndroid Build Coastguard Worker {
626*35238bceSAndroid Build Coastguard Worker sglr::GLContext context(
627*35238bceSAndroid Build Coastguard Worker m_context.getRenderContext(), m_testCtx.getLog(), sglr::GLCONTEXT_LOG_CALLS,
628*35238bceSAndroid Build Coastguard Worker tcu::IVec4(0, 0, m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight()));
629*35238bceSAndroid Build Coastguard Worker m_testFunc(m_testCtx, context);
630*35238bceSAndroid Build Coastguard Worker }
631*35238bceSAndroid Build Coastguard Worker
632*35238bceSAndroid Build Coastguard Worker GLU_EXPECT_NO_ERROR(gl.getError(), "After test case");
633*35238bceSAndroid Build Coastguard Worker
634*35238bceSAndroid Build Coastguard Worker return STOP;
635*35238bceSAndroid Build Coastguard Worker }
636*35238bceSAndroid Build Coastguard Worker
FboApiTestGroup(Context & context)637*35238bceSAndroid Build Coastguard Worker FboApiTestGroup::FboApiTestGroup(Context &context) : TestCaseGroup(context, "api", "API Tests")
638*35238bceSAndroid Build Coastguard Worker {
639*35238bceSAndroid Build Coastguard Worker }
640*35238bceSAndroid Build Coastguard Worker
~FboApiTestGroup(void)641*35238bceSAndroid Build Coastguard Worker FboApiTestGroup::~FboApiTestGroup(void)
642*35238bceSAndroid Build Coastguard Worker {
643*35238bceSAndroid Build Coastguard Worker }
644*35238bceSAndroid Build Coastguard Worker
init(void)645*35238bceSAndroid Build Coastguard Worker void FboApiTestGroup::init(void)
646*35238bceSAndroid Build Coastguard Worker {
647*35238bceSAndroid Build Coastguard Worker std::set<std::string> extensions;
648*35238bceSAndroid Build Coastguard Worker std::copy(m_context.getContextInfo().getExtensions().begin(), m_context.getContextInfo().getExtensions().end(),
649*35238bceSAndroid Build Coastguard Worker std::inserter(extensions, extensions.begin()));
650*35238bceSAndroid Build Coastguard Worker
651*35238bceSAndroid Build Coastguard Worker const glu::RenderContext &renderContext = m_context.getRenderContext();
652*35238bceSAndroid Build Coastguard Worker bool defaultFboIsZero = renderContext.getDefaultFramebuffer() == 0;
653*35238bceSAndroid Build Coastguard Worker bool isES3Compatible = gls::FboUtil::checkExtensionSupport(renderContext, "DEQP_gles3_core_compatible");
654*35238bceSAndroid Build Coastguard Worker bool hasRenderToMipmap = isES3Compatible || extensions.find("GL_OES_fbo_render_mipmap") != extensions.end();
655*35238bceSAndroid Build Coastguard Worker
656*35238bceSAndroid Build Coastguard Worker // Valid attachments
657*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "valid_tex2d_attachments", "Valid 2D texture attachments",
658*35238bceSAndroid Build Coastguard Worker validTex2DAttachmentsTest));
659*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "valid_texcube_attachments", "Valid cubemap attachments",
660*35238bceSAndroid Build Coastguard Worker validTexCubeAttachmentsTest));
661*35238bceSAndroid Build Coastguard Worker addChild(
662*35238bceSAndroid Build Coastguard Worker new FboApiCase(m_context, "valid_rbo_attachments", "Valid renderbuffer attachments", validRboAttachmentsTest));
663*35238bceSAndroid Build Coastguard Worker
664*35238bceSAndroid Build Coastguard Worker // Invalid attachments
665*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "attach_to_default_fbo", "Invalid usage: attaching to default FBO",
666*35238bceSAndroid Build Coastguard Worker defaultFboIsZero ? attachToDefaultFramebufferTest : notSupportedTest));
667*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "invalid_tex2d_attachments", "Invalid 2D texture attachments",
668*35238bceSAndroid Build Coastguard Worker invalidTex2DAttachmentTest));
669*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "invalid_texcube_attachments", "Invalid cubemap attachments",
670*35238bceSAndroid Build Coastguard Worker invalidTexCubeAttachmentTest));
671*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "invalid_rbo_attachments", "Invalid renderbuffer attachments",
672*35238bceSAndroid Build Coastguard Worker invalidRboAttachmentTest));
673*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "attach_names", "Attach allocated names without objects", attachNamesTest));
674*35238bceSAndroid Build Coastguard Worker
675*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "texture_levels", "Valid and invalid texturel levels",
676*35238bceSAndroid Build Coastguard Worker hasRenderToMipmap ? textureLevelsWithRenderToMipmapTest : textureLevelsTest));
677*35238bceSAndroid Build Coastguard Worker
678*35238bceSAndroid Build Coastguard Worker // Attachment queries
679*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "attachment_query_default_fbo", "Query attachments from default FBO",
680*35238bceSAndroid Build Coastguard Worker defaultFboIsZero ? attachmentQueryDefaultFboTest : notSupportedTest));
681*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "attachment_query_empty_fbo", "Query attachments from empty FBO",
682*35238bceSAndroid Build Coastguard Worker isES3Compatible ? es3AttachmentQueryEmptyFboTest : attachmentQueryEmptyFboTest));
683*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "attachment_query_tex2d", "Query 2d texture attachment properties",
684*35238bceSAndroid Build Coastguard Worker attachmentQueryTex2DTest));
685*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "attachment_query_texcube", "Query cubemap attachment properties",
686*35238bceSAndroid Build Coastguard Worker attachmentQueryTexCubeTest));
687*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "attachment_query_rbo", "Query renderbuffer attachment properties",
688*35238bceSAndroid Build Coastguard Worker attachmentQueryRboTest));
689*35238bceSAndroid Build Coastguard Worker
690*35238bceSAndroid Build Coastguard Worker // Delete attachments
691*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "delete_tex_2d_attached_to_bound_fbo",
692*35238bceSAndroid Build Coastguard Worker "Delete 2d texture attached to currently bound FBO", deleteTex2DAttachedToBoundFboTest));
693*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "delete_tex_cube_attached_to_bound_fbo",
694*35238bceSAndroid Build Coastguard Worker "Delete cubemap attached to currently bound FBO", deleteTexCubeAttachedToBoundFboTest));
695*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "delete_rbo_attached_to_bound_fbo",
696*35238bceSAndroid Build Coastguard Worker "Delete renderbuffer attached to currently bound FBO", deleteRboAttachedToBoundFboTest));
697*35238bceSAndroid Build Coastguard Worker
698*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "delete_tex_2d_attached_to_not_bound_fbo", "Delete 2d texture attached to FBO",
699*35238bceSAndroid Build Coastguard Worker deleteTex2DAttachedToNotBoundFboTest));
700*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "delete_tex_cube_attached_to_not_bound_fbo", "Delete cubemap attached to FBO",
701*35238bceSAndroid Build Coastguard Worker deleteTexCubeAttachedToNotBoundFboTest));
702*35238bceSAndroid Build Coastguard Worker addChild(new FboApiCase(m_context, "delete_rbo_attached_to_not_bound_fbo", "Delete renderbuffer attached to FBO",
703*35238bceSAndroid Build Coastguard Worker deleteRboAttachedToNotBoundFboTest));
704*35238bceSAndroid Build Coastguard Worker }
705*35238bceSAndroid Build Coastguard Worker
706*35238bceSAndroid Build Coastguard Worker } // namespace Functional
707*35238bceSAndroid Build Coastguard Worker } // namespace gles2
708*35238bceSAndroid Build Coastguard Worker } // namespace deqp
709