1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker * drawElements Quality Program OpenGL ES 3.1 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 Negative Fragment Pipe API tests.
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "es31fNegativeFragmentApiTests.hpp"
25*35238bceSAndroid Build Coastguard Worker
26*35238bceSAndroid Build Coastguard Worker #include "gluCallLogWrapper.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "gluContextInfo.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "gluRenderContext.hpp"
29*35238bceSAndroid Build Coastguard Worker
30*35238bceSAndroid Build Coastguard Worker #include "glwDefs.hpp"
31*35238bceSAndroid Build Coastguard Worker #include "glwEnums.hpp"
32*35238bceSAndroid Build Coastguard Worker
33*35238bceSAndroid Build Coastguard Worker namespace deqp
34*35238bceSAndroid Build Coastguard Worker {
35*35238bceSAndroid Build Coastguard Worker namespace gles31
36*35238bceSAndroid Build Coastguard Worker {
37*35238bceSAndroid Build Coastguard Worker namespace Functional
38*35238bceSAndroid Build Coastguard Worker {
39*35238bceSAndroid Build Coastguard Worker namespace NegativeTestShared
40*35238bceSAndroid Build Coastguard Worker {
41*35238bceSAndroid Build Coastguard Worker
42*35238bceSAndroid Build Coastguard Worker using glu::CallLogWrapper;
43*35238bceSAndroid Build Coastguard Worker using tcu::TestLog;
44*35238bceSAndroid Build Coastguard Worker using namespace glw;
45*35238bceSAndroid Build Coastguard Worker
46*35238bceSAndroid Build Coastguard Worker using tcu::TestLog;
47*35238bceSAndroid Build Coastguard Worker
scissor(NegativeTestContext & ctx)48*35238bceSAndroid Build Coastguard Worker void scissor(NegativeTestContext &ctx)
49*35238bceSAndroid Build Coastguard Worker {
50*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if either width or height is negative.");
51*35238bceSAndroid Build Coastguard Worker ctx.glScissor(0, 0, -1, 0);
52*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
53*35238bceSAndroid Build Coastguard Worker ctx.glScissor(0, 0, 0, -1);
54*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
55*35238bceSAndroid Build Coastguard Worker ctx.glScissor(0, 0, -1, -1);
56*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
57*35238bceSAndroid Build Coastguard Worker ctx.endSection();
58*35238bceSAndroid Build Coastguard Worker }
59*35238bceSAndroid Build Coastguard Worker
depth_func(NegativeTestContext & ctx)60*35238bceSAndroid Build Coastguard Worker void depth_func(NegativeTestContext &ctx)
61*35238bceSAndroid Build Coastguard Worker {
62*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if func is not an accepted value.");
63*35238bceSAndroid Build Coastguard Worker ctx.glDepthFunc(-1);
64*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
65*35238bceSAndroid Build Coastguard Worker ctx.endSection();
66*35238bceSAndroid Build Coastguard Worker }
67*35238bceSAndroid Build Coastguard Worker
viewport(NegativeTestContext & ctx)68*35238bceSAndroid Build Coastguard Worker void viewport(NegativeTestContext &ctx)
69*35238bceSAndroid Build Coastguard Worker {
70*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if either width or height is negative.");
71*35238bceSAndroid Build Coastguard Worker ctx.glViewport(0, 0, -1, 1);
72*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
73*35238bceSAndroid Build Coastguard Worker ctx.glViewport(0, 0, 1, -1);
74*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
75*35238bceSAndroid Build Coastguard Worker ctx.glViewport(0, 0, -1, -1);
76*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
77*35238bceSAndroid Build Coastguard Worker ctx.endSection();
78*35238bceSAndroid Build Coastguard Worker }
79*35238bceSAndroid Build Coastguard Worker
80*35238bceSAndroid Build Coastguard Worker // Stencil functions
stencil_func(NegativeTestContext & ctx)81*35238bceSAndroid Build Coastguard Worker void stencil_func(NegativeTestContext &ctx)
82*35238bceSAndroid Build Coastguard Worker {
83*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if func is not one of the eight accepted values.");
84*35238bceSAndroid Build Coastguard Worker ctx.glStencilFunc(-1, 0, 1);
85*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
86*35238bceSAndroid Build Coastguard Worker ctx.endSection();
87*35238bceSAndroid Build Coastguard Worker }
88*35238bceSAndroid Build Coastguard Worker
stencil_func_separate(NegativeTestContext & ctx)89*35238bceSAndroid Build Coastguard Worker void stencil_func_separate(NegativeTestContext &ctx)
90*35238bceSAndroid Build Coastguard Worker {
91*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
92*35238bceSAndroid Build Coastguard Worker ctx.glStencilFuncSeparate(-1, GL_NEVER, 0, 1);
93*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
94*35238bceSAndroid Build Coastguard Worker ctx.endSection();
95*35238bceSAndroid Build Coastguard Worker
96*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if func is not one of the eight accepted values.");
97*35238bceSAndroid Build Coastguard Worker ctx.glStencilFuncSeparate(GL_FRONT, -1, 0, 1);
98*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
99*35238bceSAndroid Build Coastguard Worker ctx.endSection();
100*35238bceSAndroid Build Coastguard Worker }
101*35238bceSAndroid Build Coastguard Worker
stencil_op(NegativeTestContext & ctx)102*35238bceSAndroid Build Coastguard Worker void stencil_op(NegativeTestContext &ctx)
103*35238bceSAndroid Build Coastguard Worker {
104*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the defined "
105*35238bceSAndroid Build Coastguard Worker "symbolic constant values.");
106*35238bceSAndroid Build Coastguard Worker ctx.glStencilOp(-1, GL_ZERO, GL_REPLACE);
107*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
108*35238bceSAndroid Build Coastguard Worker ctx.glStencilOp(GL_KEEP, -1, GL_REPLACE);
109*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
110*35238bceSAndroid Build Coastguard Worker ctx.glStencilOp(GL_KEEP, GL_ZERO, -1);
111*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
112*35238bceSAndroid Build Coastguard Worker ctx.endSection();
113*35238bceSAndroid Build Coastguard Worker }
114*35238bceSAndroid Build Coastguard Worker
stencil_op_separate(NegativeTestContext & ctx)115*35238bceSAndroid Build Coastguard Worker void stencil_op_separate(NegativeTestContext &ctx)
116*35238bceSAndroid Build Coastguard Worker {
117*35238bceSAndroid Build Coastguard Worker ctx.beginSection(
118*35238bceSAndroid Build Coastguard Worker "GL_INVALID_ENUM is generated if face is any value other than GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
119*35238bceSAndroid Build Coastguard Worker ctx.glStencilOpSeparate(-1, GL_KEEP, GL_ZERO, GL_REPLACE);
120*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
121*35238bceSAndroid Build Coastguard Worker ctx.endSection();
122*35238bceSAndroid Build Coastguard Worker
123*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the eight "
124*35238bceSAndroid Build Coastguard Worker "defined symbolic constant values.");
125*35238bceSAndroid Build Coastguard Worker ctx.glStencilOpSeparate(GL_FRONT, -1, GL_ZERO, GL_REPLACE);
126*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
127*35238bceSAndroid Build Coastguard Worker ctx.glStencilOpSeparate(GL_FRONT, GL_KEEP, -1, GL_REPLACE);
128*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
129*35238bceSAndroid Build Coastguard Worker ctx.glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_ZERO, -1);
130*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
131*35238bceSAndroid Build Coastguard Worker ctx.endSection();
132*35238bceSAndroid Build Coastguard Worker }
133*35238bceSAndroid Build Coastguard Worker
stencil_mask_separate(NegativeTestContext & ctx)134*35238bceSAndroid Build Coastguard Worker void stencil_mask_separate(NegativeTestContext &ctx)
135*35238bceSAndroid Build Coastguard Worker {
136*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
137*35238bceSAndroid Build Coastguard Worker ctx.glStencilMaskSeparate(-1, 0);
138*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
139*35238bceSAndroid Build Coastguard Worker ctx.endSection();
140*35238bceSAndroid Build Coastguard Worker }
141*35238bceSAndroid Build Coastguard Worker
142*35238bceSAndroid Build Coastguard Worker // Blend functions
blend_equation(NegativeTestContext & ctx)143*35238bceSAndroid Build Coastguard Worker void blend_equation(NegativeTestContext &ctx)
144*35238bceSAndroid Build Coastguard Worker {
145*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
146*35238bceSAndroid Build Coastguard Worker "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
147*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquation(-1);
148*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
149*35238bceSAndroid Build Coastguard Worker ctx.endSection();
150*35238bceSAndroid Build Coastguard Worker }
151*35238bceSAndroid Build Coastguard Worker
blend_equation_separate(NegativeTestContext & ctx)152*35238bceSAndroid Build Coastguard Worker void blend_equation_separate(NegativeTestContext &ctx)
153*35238bceSAndroid Build Coastguard Worker {
154*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
155*35238bceSAndroid Build Coastguard Worker "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
156*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationSeparate(-1, GL_FUNC_ADD);
157*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
158*35238bceSAndroid Build Coastguard Worker ctx.endSection();
159*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
160*35238bceSAndroid Build Coastguard Worker "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
161*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationSeparate(GL_FUNC_ADD, -1);
162*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
163*35238bceSAndroid Build Coastguard Worker ctx.endSection();
164*35238bceSAndroid Build Coastguard Worker }
165*35238bceSAndroid Build Coastguard Worker
checkSupport(NegativeTestContext & ctx)166*35238bceSAndroid Build Coastguard Worker static bool checkSupport(NegativeTestContext &ctx)
167*35238bceSAndroid Build Coastguard Worker {
168*35238bceSAndroid Build Coastguard Worker return contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
169*35238bceSAndroid Build Coastguard Worker contextSupports(ctx.getRenderContext().getType(), glu::ApiType::core(4, 5)) ||
170*35238bceSAndroid Build Coastguard Worker ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed");
171*35238bceSAndroid Build Coastguard Worker }
172*35238bceSAndroid Build Coastguard Worker
blend_equationi(NegativeTestContext & ctx)173*35238bceSAndroid Build Coastguard Worker void blend_equationi(NegativeTestContext &ctx)
174*35238bceSAndroid Build Coastguard Worker {
175*35238bceSAndroid Build Coastguard Worker glw::GLint maxDrawBuffers = -1;
176*35238bceSAndroid Build Coastguard Worker
177*35238bceSAndroid Build Coastguard Worker if (!checkSupport(ctx))
178*35238bceSAndroid Build Coastguard Worker throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
179*35238bceSAndroid Build Coastguard Worker
180*35238bceSAndroid Build Coastguard Worker ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
181*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
182*35238bceSAndroid Build Coastguard Worker "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
183*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationi(0, -1);
184*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
185*35238bceSAndroid Build Coastguard Worker ctx.endSection();
186*35238bceSAndroid Build Coastguard Worker ctx.beginSection(
187*35238bceSAndroid Build Coastguard Worker "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
188*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationi(-1, GL_FUNC_ADD);
189*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
190*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationi(maxDrawBuffers, GL_FUNC_ADD);
191*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
192*35238bceSAndroid Build Coastguard Worker ctx.endSection();
193*35238bceSAndroid Build Coastguard Worker }
194*35238bceSAndroid Build Coastguard Worker
blend_equation_separatei(NegativeTestContext & ctx)195*35238bceSAndroid Build Coastguard Worker void blend_equation_separatei(NegativeTestContext &ctx)
196*35238bceSAndroid Build Coastguard Worker {
197*35238bceSAndroid Build Coastguard Worker glw::GLint maxDrawBuffers = -1;
198*35238bceSAndroid Build Coastguard Worker
199*35238bceSAndroid Build Coastguard Worker if (!checkSupport(ctx))
200*35238bceSAndroid Build Coastguard Worker throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
201*35238bceSAndroid Build Coastguard Worker
202*35238bceSAndroid Build Coastguard Worker ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
203*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
204*35238bceSAndroid Build Coastguard Worker "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
205*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationSeparatei(0, -1, GL_FUNC_ADD);
206*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
207*35238bceSAndroid Build Coastguard Worker ctx.endSection();
208*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
209*35238bceSAndroid Build Coastguard Worker "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
210*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationSeparatei(0, GL_FUNC_ADD, -1);
211*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
212*35238bceSAndroid Build Coastguard Worker ctx.endSection();
213*35238bceSAndroid Build Coastguard Worker ctx.beginSection(
214*35238bceSAndroid Build Coastguard Worker "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
215*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationSeparatei(-1, GL_FUNC_ADD, GL_FUNC_ADD);
216*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
217*35238bceSAndroid Build Coastguard Worker ctx.glBlendEquationSeparatei(maxDrawBuffers, GL_FUNC_ADD, GL_FUNC_ADD);
218*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
219*35238bceSAndroid Build Coastguard Worker ctx.endSection();
220*35238bceSAndroid Build Coastguard Worker }
221*35238bceSAndroid Build Coastguard Worker
blend_func(NegativeTestContext & ctx)222*35238bceSAndroid Build Coastguard Worker void blend_func(NegativeTestContext &ctx)
223*35238bceSAndroid Build Coastguard Worker {
224*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
225*35238bceSAndroid Build Coastguard Worker ctx.glBlendFunc(-1, GL_ONE);
226*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
227*35238bceSAndroid Build Coastguard Worker ctx.glBlendFunc(GL_ONE, -1);
228*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
229*35238bceSAndroid Build Coastguard Worker ctx.endSection();
230*35238bceSAndroid Build Coastguard Worker }
231*35238bceSAndroid Build Coastguard Worker
blend_func_separate(NegativeTestContext & ctx)232*35238bceSAndroid Build Coastguard Worker void blend_func_separate(NegativeTestContext &ctx)
233*35238bceSAndroid Build Coastguard Worker {
234*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
235*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparate(-1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
236*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
237*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparate(GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
238*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
239*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparate(GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
240*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
241*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
242*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
243*35238bceSAndroid Build Coastguard Worker ctx.endSection();
244*35238bceSAndroid Build Coastguard Worker }
245*35238bceSAndroid Build Coastguard Worker
blend_funci(NegativeTestContext & ctx)246*35238bceSAndroid Build Coastguard Worker void blend_funci(NegativeTestContext &ctx)
247*35238bceSAndroid Build Coastguard Worker {
248*35238bceSAndroid Build Coastguard Worker glw::GLint maxDrawBuffers = -1;
249*35238bceSAndroid Build Coastguard Worker
250*35238bceSAndroid Build Coastguard Worker if (!checkSupport(ctx))
251*35238bceSAndroid Build Coastguard Worker throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
252*35238bceSAndroid Build Coastguard Worker
253*35238bceSAndroid Build Coastguard Worker ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
254*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
255*35238bceSAndroid Build Coastguard Worker ctx.glBlendFunci(0, -1, GL_ONE);
256*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
257*35238bceSAndroid Build Coastguard Worker ctx.glBlendFunci(0, GL_ONE, -1);
258*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
259*35238bceSAndroid Build Coastguard Worker ctx.endSection();
260*35238bceSAndroid Build Coastguard Worker ctx.beginSection(
261*35238bceSAndroid Build Coastguard Worker "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
262*35238bceSAndroid Build Coastguard Worker ctx.glBlendFunci(-1, GL_ONE, GL_ONE);
263*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
264*35238bceSAndroid Build Coastguard Worker ctx.glBlendFunci(maxDrawBuffers, GL_ONE, GL_ONE);
265*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
266*35238bceSAndroid Build Coastguard Worker ctx.endSection();
267*35238bceSAndroid Build Coastguard Worker }
268*35238bceSAndroid Build Coastguard Worker
blend_func_separatei(NegativeTestContext & ctx)269*35238bceSAndroid Build Coastguard Worker void blend_func_separatei(NegativeTestContext &ctx)
270*35238bceSAndroid Build Coastguard Worker {
271*35238bceSAndroid Build Coastguard Worker glw::GLint maxDrawBuffers = -1;
272*35238bceSAndroid Build Coastguard Worker
273*35238bceSAndroid Build Coastguard Worker if (!checkSupport(ctx))
274*35238bceSAndroid Build Coastguard Worker throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
275*35238bceSAndroid Build Coastguard Worker
276*35238bceSAndroid Build Coastguard Worker ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
277*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
278*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparatei(0, -1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
279*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
280*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparatei(0, GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
281*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
282*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
283*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
284*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
285*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
286*35238bceSAndroid Build Coastguard Worker ctx.endSection();
287*35238bceSAndroid Build Coastguard Worker ctx.beginSection(
288*35238bceSAndroid Build Coastguard Worker "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
289*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparatei(-1, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
290*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
291*35238bceSAndroid Build Coastguard Worker ctx.glBlendFuncSeparatei(maxDrawBuffers, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
292*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
293*35238bceSAndroid Build Coastguard Worker ctx.endSection();
294*35238bceSAndroid Build Coastguard Worker }
295*35238bceSAndroid Build Coastguard Worker
296*35238bceSAndroid Build Coastguard Worker // Rasterization API functions
cull_face(NegativeTestContext & ctx)297*35238bceSAndroid Build Coastguard Worker void cull_face(NegativeTestContext &ctx)
298*35238bceSAndroid Build Coastguard Worker {
299*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
300*35238bceSAndroid Build Coastguard Worker ctx.glCullFace(-1);
301*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
302*35238bceSAndroid Build Coastguard Worker ctx.endSection();
303*35238bceSAndroid Build Coastguard Worker }
304*35238bceSAndroid Build Coastguard Worker
front_face(NegativeTestContext & ctx)305*35238bceSAndroid Build Coastguard Worker void front_face(NegativeTestContext &ctx)
306*35238bceSAndroid Build Coastguard Worker {
307*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
308*35238bceSAndroid Build Coastguard Worker ctx.glFrontFace(-1);
309*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
310*35238bceSAndroid Build Coastguard Worker ctx.endSection();
311*35238bceSAndroid Build Coastguard Worker }
312*35238bceSAndroid Build Coastguard Worker
line_width(NegativeTestContext & ctx)313*35238bceSAndroid Build Coastguard Worker void line_width(NegativeTestContext &ctx)
314*35238bceSAndroid Build Coastguard Worker {
315*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if width is less than or equal to 0.");
316*35238bceSAndroid Build Coastguard Worker ctx.glLineWidth(0);
317*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
318*35238bceSAndroid Build Coastguard Worker ctx.glLineWidth(-1);
319*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
320*35238bceSAndroid Build Coastguard Worker ctx.endSection();
321*35238bceSAndroid Build Coastguard Worker }
322*35238bceSAndroid Build Coastguard Worker
323*35238bceSAndroid Build Coastguard Worker // Asynchronous queries
gen_queries(NegativeTestContext & ctx)324*35238bceSAndroid Build Coastguard Worker void gen_queries(NegativeTestContext &ctx)
325*35238bceSAndroid Build Coastguard Worker {
326*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
327*35238bceSAndroid Build Coastguard Worker GLuint ids = 0;
328*35238bceSAndroid Build Coastguard Worker ctx.glGenQueries(-1, &ids);
329*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
330*35238bceSAndroid Build Coastguard Worker ctx.endSection();
331*35238bceSAndroid Build Coastguard Worker }
332*35238bceSAndroid Build Coastguard Worker
begin_query(NegativeTestContext & ctx)333*35238bceSAndroid Build Coastguard Worker void begin_query(NegativeTestContext &ctx)
334*35238bceSAndroid Build Coastguard Worker {
335*35238bceSAndroid Build Coastguard Worker GLuint ids[3];
336*35238bceSAndroid Build Coastguard Worker ctx.glGenQueries(3, ids);
337*35238bceSAndroid Build Coastguard Worker
338*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
339*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(-1, ids[0]);
340*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
341*35238bceSAndroid Build Coastguard Worker ctx.endSection();
342*35238bceSAndroid Build Coastguard Worker
343*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_OPERATION is generated if ctx.glBeginQuery is executed while a query object of the "
344*35238bceSAndroid Build Coastguard Worker "same target is already active.");
345*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[0]);
346*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
347*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[1]);
348*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
349*35238bceSAndroid Build Coastguard Worker // \note GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE alias to the same target for the purposes of this error.
350*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED_CONSERVATIVE, ids[1]);
351*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
352*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[1]);
353*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
354*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[2]);
355*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
356*35238bceSAndroid Build Coastguard Worker ctx.glEndQuery(GL_ANY_SAMPLES_PASSED);
357*35238bceSAndroid Build Coastguard Worker ctx.glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
358*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
359*35238bceSAndroid Build Coastguard Worker ctx.endSection();
360*35238bceSAndroid Build Coastguard Worker
361*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_OPERATION is generated if id is 0.");
362*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED, 0);
363*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
364*35238bceSAndroid Build Coastguard Worker ctx.endSection();
365*35238bceSAndroid Build Coastguard Worker
366*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_OPERATION is generated if id not a name returned from a previous call to "
367*35238bceSAndroid Build Coastguard Worker "ctx.glGenQueries, or if such a name has since been deleted with ctx.glDeleteQueries.");
368*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED, -1);
369*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
370*35238bceSAndroid Build Coastguard Worker ctx.glDeleteQueries(1, &ids[2]);
371*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
372*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[2]);
373*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
374*35238bceSAndroid Build Coastguard Worker ctx.endSection();
375*35238bceSAndroid Build Coastguard Worker
376*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_OPERATION is generated if id is the name of an already active query object.");
377*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[0]);
378*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
379*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
380*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
381*35238bceSAndroid Build Coastguard Worker ctx.endSection();
382*35238bceSAndroid Build Coastguard Worker
383*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_OPERATION is generated if id refers to an existing query object whose type does not "
384*35238bceSAndroid Build Coastguard Worker "does not match target.");
385*35238bceSAndroid Build Coastguard Worker ctx.glEndQuery(GL_ANY_SAMPLES_PASSED);
386*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
387*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
388*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
389*35238bceSAndroid Build Coastguard Worker ctx.endSection();
390*35238bceSAndroid Build Coastguard Worker
391*35238bceSAndroid Build Coastguard Worker ctx.glDeleteQueries(2, &ids[0]);
392*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
393*35238bceSAndroid Build Coastguard Worker }
394*35238bceSAndroid Build Coastguard Worker
end_query(NegativeTestContext & ctx)395*35238bceSAndroid Build Coastguard Worker void end_query(NegativeTestContext &ctx)
396*35238bceSAndroid Build Coastguard Worker {
397*35238bceSAndroid Build Coastguard Worker GLuint id = 0;
398*35238bceSAndroid Build Coastguard Worker ctx.glGenQueries(1, &id);
399*35238bceSAndroid Build Coastguard Worker
400*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
401*35238bceSAndroid Build Coastguard Worker ctx.glEndQuery(-1);
402*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
403*35238bceSAndroid Build Coastguard Worker ctx.endSection();
404*35238bceSAndroid Build Coastguard Worker
405*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_OPERATION is generated if ctx.glEndQuery is executed when a query object of the same "
406*35238bceSAndroid Build Coastguard Worker "target is not active.");
407*35238bceSAndroid Build Coastguard Worker ctx.glEndQuery(GL_ANY_SAMPLES_PASSED);
408*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
409*35238bceSAndroid Build Coastguard Worker ctx.glBeginQuery(GL_ANY_SAMPLES_PASSED, id);
410*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
411*35238bceSAndroid Build Coastguard Worker ctx.glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
412*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_OPERATION);
413*35238bceSAndroid Build Coastguard Worker ctx.glEndQuery(GL_ANY_SAMPLES_PASSED);
414*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
415*35238bceSAndroid Build Coastguard Worker ctx.endSection();
416*35238bceSAndroid Build Coastguard Worker
417*35238bceSAndroid Build Coastguard Worker ctx.glDeleteQueries(1, &id);
418*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
419*35238bceSAndroid Build Coastguard Worker }
420*35238bceSAndroid Build Coastguard Worker
delete_queries(NegativeTestContext & ctx)421*35238bceSAndroid Build Coastguard Worker void delete_queries(NegativeTestContext &ctx)
422*35238bceSAndroid Build Coastguard Worker {
423*35238bceSAndroid Build Coastguard Worker GLuint id = 0;
424*35238bceSAndroid Build Coastguard Worker ctx.glGenQueries(1, &id);
425*35238bceSAndroid Build Coastguard Worker
426*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
427*35238bceSAndroid Build Coastguard Worker ctx.glDeleteQueries(-1, &id);
428*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
429*35238bceSAndroid Build Coastguard Worker ctx.endSection();
430*35238bceSAndroid Build Coastguard Worker
431*35238bceSAndroid Build Coastguard Worker ctx.glDeleteQueries(1, &id);
432*35238bceSAndroid Build Coastguard Worker }
433*35238bceSAndroid Build Coastguard Worker
434*35238bceSAndroid Build Coastguard Worker // Sync objects
fence_sync(NegativeTestContext & ctx)435*35238bceSAndroid Build Coastguard Worker void fence_sync(NegativeTestContext &ctx)
436*35238bceSAndroid Build Coastguard Worker {
437*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_ENUM is generated if condition is not GL_SYNC_GPU_COMMANDS_COMPLETE.");
438*35238bceSAndroid Build Coastguard Worker ctx.glFenceSync(-1, 0);
439*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_ENUM);
440*35238bceSAndroid Build Coastguard Worker ctx.endSection();
441*35238bceSAndroid Build Coastguard Worker
442*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if flags is not zero.");
443*35238bceSAndroid Build Coastguard Worker ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0x0010);
444*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
445*35238bceSAndroid Build Coastguard Worker ctx.endSection();
446*35238bceSAndroid Build Coastguard Worker }
447*35238bceSAndroid Build Coastguard Worker
wait_sync(NegativeTestContext & ctx)448*35238bceSAndroid Build Coastguard Worker void wait_sync(NegativeTestContext &ctx)
449*35238bceSAndroid Build Coastguard Worker {
450*35238bceSAndroid Build Coastguard Worker GLsync sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
451*35238bceSAndroid Build Coastguard Worker
452*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of a sync object.");
453*35238bceSAndroid Build Coastguard Worker ctx.glWaitSync(0, 0, GL_TIMEOUT_IGNORED);
454*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
455*35238bceSAndroid Build Coastguard Worker ctx.endSection();
456*35238bceSAndroid Build Coastguard Worker
457*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if flags is not zero.");
458*35238bceSAndroid Build Coastguard Worker ctx.glWaitSync(sync, 0x0010, GL_TIMEOUT_IGNORED);
459*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
460*35238bceSAndroid Build Coastguard Worker ctx.endSection();
461*35238bceSAndroid Build Coastguard Worker
462*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if timeout is not GL_TIMEOUT_IGNORED.");
463*35238bceSAndroid Build Coastguard Worker ctx.glWaitSync(sync, 0, 0);
464*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
465*35238bceSAndroid Build Coastguard Worker ctx.endSection();
466*35238bceSAndroid Build Coastguard Worker
467*35238bceSAndroid Build Coastguard Worker ctx.glDeleteSync(sync);
468*35238bceSAndroid Build Coastguard Worker }
469*35238bceSAndroid Build Coastguard Worker
client_wait_sync(NegativeTestContext & ctx)470*35238bceSAndroid Build Coastguard Worker void client_wait_sync(NegativeTestContext &ctx)
471*35238bceSAndroid Build Coastguard Worker {
472*35238bceSAndroid Build Coastguard Worker GLsync sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
473*35238bceSAndroid Build Coastguard Worker
474*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of an existing sync object.");
475*35238bceSAndroid Build Coastguard Worker ctx.glClientWaitSync(0, 0, 10000);
476*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
477*35238bceSAndroid Build Coastguard Worker ctx.endSection();
478*35238bceSAndroid Build Coastguard Worker
479*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if flags contains any unsupported flag.");
480*35238bceSAndroid Build Coastguard Worker ctx.glClientWaitSync(sync, 0x00000004, 10000);
481*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
482*35238bceSAndroid Build Coastguard Worker ctx.endSection();
483*35238bceSAndroid Build Coastguard Worker
484*35238bceSAndroid Build Coastguard Worker ctx.glDeleteSync(sync);
485*35238bceSAndroid Build Coastguard Worker }
486*35238bceSAndroid Build Coastguard Worker
delete_sync(NegativeTestContext & ctx)487*35238bceSAndroid Build Coastguard Worker void delete_sync(NegativeTestContext &ctx)
488*35238bceSAndroid Build Coastguard Worker {
489*35238bceSAndroid Build Coastguard Worker ctx.beginSection("GL_INVALID_VALUE is generated if sync is neither zero or the name of a sync object.");
490*35238bceSAndroid Build Coastguard Worker ctx.glDeleteSync((GLsync)1);
491*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_INVALID_VALUE);
492*35238bceSAndroid Build Coastguard Worker ctx.glDeleteSync(0);
493*35238bceSAndroid Build Coastguard Worker ctx.expectError(GL_NO_ERROR);
494*35238bceSAndroid Build Coastguard Worker ctx.endSection();
495*35238bceSAndroid Build Coastguard Worker }
496*35238bceSAndroid Build Coastguard Worker
getNegativeFragmentApiTestFunctions()497*35238bceSAndroid Build Coastguard Worker std::vector<FunctionContainer> getNegativeFragmentApiTestFunctions()
498*35238bceSAndroid Build Coastguard Worker {
499*35238bceSAndroid Build Coastguard Worker FunctionContainer funcs[] = {
500*35238bceSAndroid Build Coastguard Worker {scissor, "scissor", "Invalid glScissor() usage"},
501*35238bceSAndroid Build Coastguard Worker {depth_func, "depth_func", "Invalid glDepthFunc() usage"},
502*35238bceSAndroid Build Coastguard Worker {viewport, "viewport", "Invalid glViewport() usage"},
503*35238bceSAndroid Build Coastguard Worker {stencil_func, "stencil_func", "Invalid glStencilFunc() usage"},
504*35238bceSAndroid Build Coastguard Worker {stencil_func_separate, "stencil_func_separate", "Invalid glStencilFuncSeparate() usage"},
505*35238bceSAndroid Build Coastguard Worker {stencil_op, "stencil_op", "Invalid glStencilOp() usage"},
506*35238bceSAndroid Build Coastguard Worker {stencil_op_separate, "stencil_op_separate", "Invalid glStencilOpSeparate() usage"},
507*35238bceSAndroid Build Coastguard Worker {stencil_mask_separate, "stencil_mask_separate", "Invalid glStencilMaskSeparate() usage"},
508*35238bceSAndroid Build Coastguard Worker {blend_equation, "blend_equation", "Invalid glBlendEquation() usage"},
509*35238bceSAndroid Build Coastguard Worker {blend_equationi, "blend_equationi", "Invalid glBlendEquationi() usage"},
510*35238bceSAndroid Build Coastguard Worker {blend_equation_separate, "blend_equation_separate", "Invalid glBlendEquationSeparate() usage"},
511*35238bceSAndroid Build Coastguard Worker {blend_equation_separatei, "blend_equation_separatei", "Invalid glBlendEquationSeparatei() usage"},
512*35238bceSAndroid Build Coastguard Worker {blend_func, "blend_func", "Invalid glBlendFunc() usage"},
513*35238bceSAndroid Build Coastguard Worker {blend_funci, "blend_funci", "Invalid glBlendFunci() usage"},
514*35238bceSAndroid Build Coastguard Worker {blend_func_separate, "blend_func_separate", "Invalid glBlendFuncSeparate() usage"},
515*35238bceSAndroid Build Coastguard Worker {blend_func_separatei, "blend_func_separatei", "Invalid glBlendFuncSeparatei() usage"},
516*35238bceSAndroid Build Coastguard Worker {cull_face, "cull_face", "Invalid glCullFace() usage"},
517*35238bceSAndroid Build Coastguard Worker {front_face, "front_face", "Invalid glFrontFace() usage"},
518*35238bceSAndroid Build Coastguard Worker {line_width, "line_width", "Invalid glLineWidth() usage"},
519*35238bceSAndroid Build Coastguard Worker {gen_queries, "gen_queries", "Invalid glGenQueries() usage"},
520*35238bceSAndroid Build Coastguard Worker {begin_query, "begin_query", "Invalid glBeginQuery() usage"},
521*35238bceSAndroid Build Coastguard Worker {end_query, "end_query", "Invalid glEndQuery() usage"},
522*35238bceSAndroid Build Coastguard Worker {delete_queries, "delete_queries", "Invalid glDeleteQueries() usage"},
523*35238bceSAndroid Build Coastguard Worker {fence_sync, "fence_sync", "Invalid glFenceSync() usage"},
524*35238bceSAndroid Build Coastguard Worker {wait_sync, "wait_sync", "Invalid glWaitSync() usage"},
525*35238bceSAndroid Build Coastguard Worker {client_wait_sync, "client_wait_sync", "Invalid glClientWaitSync() usage"},
526*35238bceSAndroid Build Coastguard Worker {delete_sync, "delete_sync", "Invalid glDeleteSync() usage"},
527*35238bceSAndroid Build Coastguard Worker };
528*35238bceSAndroid Build Coastguard Worker
529*35238bceSAndroid Build Coastguard Worker return std::vector<FunctionContainer>(DE_ARRAY_BEGIN(funcs), DE_ARRAY_END(funcs));
530*35238bceSAndroid Build Coastguard Worker }
531*35238bceSAndroid Build Coastguard Worker
532*35238bceSAndroid Build Coastguard Worker } // namespace NegativeTestShared
533*35238bceSAndroid Build Coastguard Worker } // namespace Functional
534*35238bceSAndroid Build Coastguard Worker } // namespace gles31
535*35238bceSAndroid Build Coastguard Worker } // namespace deqp
536