1*8975f5c5SAndroid Build Coastguard Worker //
2*8975f5c5SAndroid Build Coastguard Worker // Copyright 2019 The ANGLE Project Authors. All rights reserved.
3*8975f5c5SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
4*8975f5c5SAndroid Build Coastguard Worker // found in the LICENSE file.
5*8975f5c5SAndroid Build Coastguard Worker //
6*8975f5c5SAndroid Build Coastguard Worker
7*8975f5c5SAndroid Build Coastguard Worker // validationES32.cpp: Validation functions for OpenGL ES 3.2 entry point parameters
8*8975f5c5SAndroid Build Coastguard Worker
9*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/validationES32_autogen.h"
10*8975f5c5SAndroid Build Coastguard Worker
11*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/Context.h"
12*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/ErrorStrings.h"
13*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/Framebuffer.h"
14*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/VertexArray.h"
15*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/validationES.h"
16*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/validationES2.h"
17*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/validationES3.h"
18*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/validationES31.h"
19*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/validationES31_autogen.h"
20*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/validationES3_autogen.h"
21*8975f5c5SAndroid Build Coastguard Worker
22*8975f5c5SAndroid Build Coastguard Worker #include "common/utilities.h"
23*8975f5c5SAndroid Build Coastguard Worker
24*8975f5c5SAndroid Build Coastguard Worker using namespace angle;
25*8975f5c5SAndroid Build Coastguard Worker
26*8975f5c5SAndroid Build Coastguard Worker namespace gl
27*8975f5c5SAndroid Build Coastguard Worker {
28*8975f5c5SAndroid Build Coastguard Worker using namespace err;
29*8975f5c5SAndroid Build Coastguard Worker
30*8975f5c5SAndroid Build Coastguard Worker namespace
31*8975f5c5SAndroid Build Coastguard Worker {
32*8975f5c5SAndroid Build Coastguard Worker // ANGLE_shader_pixel_local_storage: INVALID_OPERATION is generated by Enablei*(), Disablei*() if
33*8975f5c5SAndroid Build Coastguard Worker // <cap> is not one of: BLEND, SCISSOR_TEST, SCISSOR_TEST_EXCLUSIVE_NV.
IsIndexedCapBannedWithActivePLS(GLenum cap)34*8975f5c5SAndroid Build Coastguard Worker static bool IsIndexedCapBannedWithActivePLS(GLenum cap)
35*8975f5c5SAndroid Build Coastguard Worker {
36*8975f5c5SAndroid Build Coastguard Worker switch (cap)
37*8975f5c5SAndroid Build Coastguard Worker {
38*8975f5c5SAndroid Build Coastguard Worker case GL_BLEND:
39*8975f5c5SAndroid Build Coastguard Worker case GL_SCISSOR_TEST:
40*8975f5c5SAndroid Build Coastguard Worker case GL_SCISSOR_TEST_EXCLUSIVE_NV:
41*8975f5c5SAndroid Build Coastguard Worker return false;
42*8975f5c5SAndroid Build Coastguard Worker default:
43*8975f5c5SAndroid Build Coastguard Worker return true;
44*8975f5c5SAndroid Build Coastguard Worker }
45*8975f5c5SAndroid Build Coastguard Worker }
46*8975f5c5SAndroid Build Coastguard Worker } // anonymous namespace
47*8975f5c5SAndroid Build Coastguard Worker
ValidateBlendBarrier(const Context * context,angle::EntryPoint entryPoint)48*8975f5c5SAndroid Build Coastguard Worker bool ValidateBlendBarrier(const Context *context, angle::EntryPoint entryPoint)
49*8975f5c5SAndroid Build Coastguard Worker {
50*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
51*8975f5c5SAndroid Build Coastguard Worker {
52*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
53*8975f5c5SAndroid Build Coastguard Worker return false;
54*8975f5c5SAndroid Build Coastguard Worker }
55*8975f5c5SAndroid Build Coastguard Worker
56*8975f5c5SAndroid Build Coastguard Worker return true;
57*8975f5c5SAndroid Build Coastguard Worker }
58*8975f5c5SAndroid Build Coastguard Worker
ValidateBlendEquationSeparatei(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLuint buf,GLenum modeRGB,GLenum modeAlpha)59*8975f5c5SAndroid Build Coastguard Worker bool ValidateBlendEquationSeparatei(const PrivateState &state,
60*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
61*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
62*8975f5c5SAndroid Build Coastguard Worker GLuint buf,
63*8975f5c5SAndroid Build Coastguard Worker GLenum modeRGB,
64*8975f5c5SAndroid Build Coastguard Worker GLenum modeAlpha)
65*8975f5c5SAndroid Build Coastguard Worker {
66*8975f5c5SAndroid Build Coastguard Worker if (buf >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
67*8975f5c5SAndroid Build Coastguard Worker {
68*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kExceedsMaxDrawBuffers);
69*8975f5c5SAndroid Build Coastguard Worker return false;
70*8975f5c5SAndroid Build Coastguard Worker }
71*8975f5c5SAndroid Build Coastguard Worker
72*8975f5c5SAndroid Build Coastguard Worker if (!ValidateBlendEquationSeparate(state, errors, entryPoint, modeRGB, modeAlpha))
73*8975f5c5SAndroid Build Coastguard Worker {
74*8975f5c5SAndroid Build Coastguard Worker // error already generated
75*8975f5c5SAndroid Build Coastguard Worker return false;
76*8975f5c5SAndroid Build Coastguard Worker }
77*8975f5c5SAndroid Build Coastguard Worker
78*8975f5c5SAndroid Build Coastguard Worker return true;
79*8975f5c5SAndroid Build Coastguard Worker }
80*8975f5c5SAndroid Build Coastguard Worker
ValidateBlendEquationi(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLuint buf,GLenum mode)81*8975f5c5SAndroid Build Coastguard Worker bool ValidateBlendEquationi(const PrivateState &state,
82*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
83*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
84*8975f5c5SAndroid Build Coastguard Worker GLuint buf,
85*8975f5c5SAndroid Build Coastguard Worker GLenum mode)
86*8975f5c5SAndroid Build Coastguard Worker {
87*8975f5c5SAndroid Build Coastguard Worker if (buf >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
88*8975f5c5SAndroid Build Coastguard Worker {
89*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kExceedsMaxDrawBuffers);
90*8975f5c5SAndroid Build Coastguard Worker return false;
91*8975f5c5SAndroid Build Coastguard Worker }
92*8975f5c5SAndroid Build Coastguard Worker
93*8975f5c5SAndroid Build Coastguard Worker if (!ValidateBlendEquation(state, errors, entryPoint, mode))
94*8975f5c5SAndroid Build Coastguard Worker {
95*8975f5c5SAndroid Build Coastguard Worker // error already generated
96*8975f5c5SAndroid Build Coastguard Worker return false;
97*8975f5c5SAndroid Build Coastguard Worker }
98*8975f5c5SAndroid Build Coastguard Worker
99*8975f5c5SAndroid Build Coastguard Worker return true;
100*8975f5c5SAndroid Build Coastguard Worker }
101*8975f5c5SAndroid Build Coastguard Worker
ValidateBlendFuncSeparatei(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLuint buf,GLenum srcRGB,GLenum dstRGB,GLenum srcAlpha,GLenum dstAlpha)102*8975f5c5SAndroid Build Coastguard Worker bool ValidateBlendFuncSeparatei(const PrivateState &state,
103*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
104*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
105*8975f5c5SAndroid Build Coastguard Worker GLuint buf,
106*8975f5c5SAndroid Build Coastguard Worker GLenum srcRGB,
107*8975f5c5SAndroid Build Coastguard Worker GLenum dstRGB,
108*8975f5c5SAndroid Build Coastguard Worker GLenum srcAlpha,
109*8975f5c5SAndroid Build Coastguard Worker GLenum dstAlpha)
110*8975f5c5SAndroid Build Coastguard Worker {
111*8975f5c5SAndroid Build Coastguard Worker if (buf >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
112*8975f5c5SAndroid Build Coastguard Worker {
113*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kExceedsMaxDrawBuffers);
114*8975f5c5SAndroid Build Coastguard Worker return false;
115*8975f5c5SAndroid Build Coastguard Worker }
116*8975f5c5SAndroid Build Coastguard Worker
117*8975f5c5SAndroid Build Coastguard Worker if (!ValidateBlendFuncSeparate(state, errors, entryPoint, srcRGB, dstRGB, srcAlpha, dstAlpha))
118*8975f5c5SAndroid Build Coastguard Worker {
119*8975f5c5SAndroid Build Coastguard Worker // error already generated
120*8975f5c5SAndroid Build Coastguard Worker return false;
121*8975f5c5SAndroid Build Coastguard Worker }
122*8975f5c5SAndroid Build Coastguard Worker
123*8975f5c5SAndroid Build Coastguard Worker return true;
124*8975f5c5SAndroid Build Coastguard Worker }
125*8975f5c5SAndroid Build Coastguard Worker
ValidateBlendFunci(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLuint buf,GLenum src,GLenum dst)126*8975f5c5SAndroid Build Coastguard Worker bool ValidateBlendFunci(const PrivateState &state,
127*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
128*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
129*8975f5c5SAndroid Build Coastguard Worker GLuint buf,
130*8975f5c5SAndroid Build Coastguard Worker GLenum src,
131*8975f5c5SAndroid Build Coastguard Worker GLenum dst)
132*8975f5c5SAndroid Build Coastguard Worker {
133*8975f5c5SAndroid Build Coastguard Worker if (buf >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
134*8975f5c5SAndroid Build Coastguard Worker {
135*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kExceedsMaxDrawBuffers);
136*8975f5c5SAndroid Build Coastguard Worker return false;
137*8975f5c5SAndroid Build Coastguard Worker }
138*8975f5c5SAndroid Build Coastguard Worker
139*8975f5c5SAndroid Build Coastguard Worker if (!ValidateBlendFunc(state, errors, entryPoint, src, dst))
140*8975f5c5SAndroid Build Coastguard Worker {
141*8975f5c5SAndroid Build Coastguard Worker // error already generated
142*8975f5c5SAndroid Build Coastguard Worker return false;
143*8975f5c5SAndroid Build Coastguard Worker }
144*8975f5c5SAndroid Build Coastguard Worker
145*8975f5c5SAndroid Build Coastguard Worker return true;
146*8975f5c5SAndroid Build Coastguard Worker }
147*8975f5c5SAndroid Build Coastguard Worker
ValidateColorMaski(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLuint buf,GLboolean r,GLboolean g,GLboolean b,GLboolean a)148*8975f5c5SAndroid Build Coastguard Worker bool ValidateColorMaski(const PrivateState &state,
149*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
150*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
151*8975f5c5SAndroid Build Coastguard Worker GLuint buf,
152*8975f5c5SAndroid Build Coastguard Worker GLboolean r,
153*8975f5c5SAndroid Build Coastguard Worker GLboolean g,
154*8975f5c5SAndroid Build Coastguard Worker GLboolean b,
155*8975f5c5SAndroid Build Coastguard Worker GLboolean a)
156*8975f5c5SAndroid Build Coastguard Worker {
157*8975f5c5SAndroid Build Coastguard Worker if (buf >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
158*8975f5c5SAndroid Build Coastguard Worker {
159*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kIndexExceedsMaxDrawBuffer);
160*8975f5c5SAndroid Build Coastguard Worker return false;
161*8975f5c5SAndroid Build Coastguard Worker }
162*8975f5c5SAndroid Build Coastguard Worker
163*8975f5c5SAndroid Build Coastguard Worker return true;
164*8975f5c5SAndroid Build Coastguard Worker }
165*8975f5c5SAndroid Build Coastguard Worker
ValidateCopyImageSubData(const Context * context,angle::EntryPoint entryPoint,GLuint srcName,GLenum srcTarget,GLint srcLevel,GLint srcX,GLint srcY,GLint srcZ,GLuint dstName,GLenum dstTarget,GLint dstLevel,GLint dstX,GLint dstY,GLint dstZ,GLsizei srcWidth,GLsizei srcHeight,GLsizei srcDepth)166*8975f5c5SAndroid Build Coastguard Worker bool ValidateCopyImageSubData(const Context *context,
167*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
168*8975f5c5SAndroid Build Coastguard Worker GLuint srcName,
169*8975f5c5SAndroid Build Coastguard Worker GLenum srcTarget,
170*8975f5c5SAndroid Build Coastguard Worker GLint srcLevel,
171*8975f5c5SAndroid Build Coastguard Worker GLint srcX,
172*8975f5c5SAndroid Build Coastguard Worker GLint srcY,
173*8975f5c5SAndroid Build Coastguard Worker GLint srcZ,
174*8975f5c5SAndroid Build Coastguard Worker GLuint dstName,
175*8975f5c5SAndroid Build Coastguard Worker GLenum dstTarget,
176*8975f5c5SAndroid Build Coastguard Worker GLint dstLevel,
177*8975f5c5SAndroid Build Coastguard Worker GLint dstX,
178*8975f5c5SAndroid Build Coastguard Worker GLint dstY,
179*8975f5c5SAndroid Build Coastguard Worker GLint dstZ,
180*8975f5c5SAndroid Build Coastguard Worker GLsizei srcWidth,
181*8975f5c5SAndroid Build Coastguard Worker GLsizei srcHeight,
182*8975f5c5SAndroid Build Coastguard Worker GLsizei srcDepth)
183*8975f5c5SAndroid Build Coastguard Worker {
184*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
185*8975f5c5SAndroid Build Coastguard Worker {
186*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
187*8975f5c5SAndroid Build Coastguard Worker return false;
188*8975f5c5SAndroid Build Coastguard Worker }
189*8975f5c5SAndroid Build Coastguard Worker
190*8975f5c5SAndroid Build Coastguard Worker return ValidateCopyImageSubDataBase(context, entryPoint, srcName, srcTarget, srcLevel, srcX,
191*8975f5c5SAndroid Build Coastguard Worker srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ,
192*8975f5c5SAndroid Build Coastguard Worker srcWidth, srcHeight, srcDepth);
193*8975f5c5SAndroid Build Coastguard Worker }
194*8975f5c5SAndroid Build Coastguard Worker
ValidateDebugMessageCallback(const Context * context,angle::EntryPoint entryPoint,GLDEBUGPROC callback,const void * userParam)195*8975f5c5SAndroid Build Coastguard Worker bool ValidateDebugMessageCallback(const Context *context,
196*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
197*8975f5c5SAndroid Build Coastguard Worker GLDEBUGPROC callback,
198*8975f5c5SAndroid Build Coastguard Worker const void *userParam)
199*8975f5c5SAndroid Build Coastguard Worker {
200*8975f5c5SAndroid Build Coastguard Worker return true;
201*8975f5c5SAndroid Build Coastguard Worker }
202*8975f5c5SAndroid Build Coastguard Worker
ValidateDebugMessageControl(const Context * context,angle::EntryPoint entryPoint,GLenum source,GLenum type,GLenum severity,GLsizei count,const GLuint * ids,GLboolean enabled)203*8975f5c5SAndroid Build Coastguard Worker bool ValidateDebugMessageControl(const Context *context,
204*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
205*8975f5c5SAndroid Build Coastguard Worker GLenum source,
206*8975f5c5SAndroid Build Coastguard Worker GLenum type,
207*8975f5c5SAndroid Build Coastguard Worker GLenum severity,
208*8975f5c5SAndroid Build Coastguard Worker GLsizei count,
209*8975f5c5SAndroid Build Coastguard Worker const GLuint *ids,
210*8975f5c5SAndroid Build Coastguard Worker GLboolean enabled)
211*8975f5c5SAndroid Build Coastguard Worker {
212*8975f5c5SAndroid Build Coastguard Worker return true;
213*8975f5c5SAndroid Build Coastguard Worker }
214*8975f5c5SAndroid Build Coastguard Worker
ValidateDebugMessageInsert(const Context * context,angle::EntryPoint entryPoint,GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar * buf)215*8975f5c5SAndroid Build Coastguard Worker bool ValidateDebugMessageInsert(const Context *context,
216*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
217*8975f5c5SAndroid Build Coastguard Worker GLenum source,
218*8975f5c5SAndroid Build Coastguard Worker GLenum type,
219*8975f5c5SAndroid Build Coastguard Worker GLuint id,
220*8975f5c5SAndroid Build Coastguard Worker GLenum severity,
221*8975f5c5SAndroid Build Coastguard Worker GLsizei length,
222*8975f5c5SAndroid Build Coastguard Worker const GLchar *buf)
223*8975f5c5SAndroid Build Coastguard Worker {
224*8975f5c5SAndroid Build Coastguard Worker return true;
225*8975f5c5SAndroid Build Coastguard Worker }
226*8975f5c5SAndroid Build Coastguard Worker
ValidateDisablei(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLenum target,GLuint index)227*8975f5c5SAndroid Build Coastguard Worker bool ValidateDisablei(const PrivateState &state,
228*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
229*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
230*8975f5c5SAndroid Build Coastguard Worker GLenum target,
231*8975f5c5SAndroid Build Coastguard Worker GLuint index)
232*8975f5c5SAndroid Build Coastguard Worker {
233*8975f5c5SAndroid Build Coastguard Worker int numPLSPlanes = state.getPixelLocalStorageActivePlanes();
234*8975f5c5SAndroid Build Coastguard Worker if (numPLSPlanes != 0)
235*8975f5c5SAndroid Build Coastguard Worker {
236*8975f5c5SAndroid Build Coastguard Worker if (IsIndexedCapBannedWithActivePLS(target))
237*8975f5c5SAndroid Build Coastguard Worker {
238*8975f5c5SAndroid Build Coastguard Worker errors->validationErrorF(entryPoint, GL_INVALID_OPERATION, kPLSCapNotAllowed, target);
239*8975f5c5SAndroid Build Coastguard Worker return false;
240*8975f5c5SAndroid Build Coastguard Worker }
241*8975f5c5SAndroid Build Coastguard Worker }
242*8975f5c5SAndroid Build Coastguard Worker
243*8975f5c5SAndroid Build Coastguard Worker switch (target)
244*8975f5c5SAndroid Build Coastguard Worker {
245*8975f5c5SAndroid Build Coastguard Worker case GL_BLEND:
246*8975f5c5SAndroid Build Coastguard Worker if (index >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
247*8975f5c5SAndroid Build Coastguard Worker {
248*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kIndexExceedsMaxDrawBuffer);
249*8975f5c5SAndroid Build Coastguard Worker return false;
250*8975f5c5SAndroid Build Coastguard Worker }
251*8975f5c5SAndroid Build Coastguard Worker break;
252*8975f5c5SAndroid Build Coastguard Worker default:
253*8975f5c5SAndroid Build Coastguard Worker errors->validationErrorF(entryPoint, GL_INVALID_ENUM, kEnumNotSupported, target);
254*8975f5c5SAndroid Build Coastguard Worker return false;
255*8975f5c5SAndroid Build Coastguard Worker }
256*8975f5c5SAndroid Build Coastguard Worker return true;
257*8975f5c5SAndroid Build Coastguard Worker }
258*8975f5c5SAndroid Build Coastguard Worker
ValidateDrawElementsBaseVertex(const Context * context,angle::EntryPoint entryPoint,PrimitiveMode mode,GLsizei count,DrawElementsType type,const void * indices,GLint basevertex)259*8975f5c5SAndroid Build Coastguard Worker bool ValidateDrawElementsBaseVertex(const Context *context,
260*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
261*8975f5c5SAndroid Build Coastguard Worker PrimitiveMode mode,
262*8975f5c5SAndroid Build Coastguard Worker GLsizei count,
263*8975f5c5SAndroid Build Coastguard Worker DrawElementsType type,
264*8975f5c5SAndroid Build Coastguard Worker const void *indices,
265*8975f5c5SAndroid Build Coastguard Worker GLint basevertex)
266*8975f5c5SAndroid Build Coastguard Worker {
267*8975f5c5SAndroid Build Coastguard Worker return ValidateDrawElementsCommon(context, entryPoint, mode, count, type, indices, 1);
268*8975f5c5SAndroid Build Coastguard Worker }
269*8975f5c5SAndroid Build Coastguard Worker
ValidateDrawElementsInstancedBaseVertex(const Context * context,angle::EntryPoint entryPoint,PrimitiveMode mode,GLsizei count,DrawElementsType type,const void * indices,GLsizei instancecount,GLint basevertex)270*8975f5c5SAndroid Build Coastguard Worker bool ValidateDrawElementsInstancedBaseVertex(const Context *context,
271*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
272*8975f5c5SAndroid Build Coastguard Worker PrimitiveMode mode,
273*8975f5c5SAndroid Build Coastguard Worker GLsizei count,
274*8975f5c5SAndroid Build Coastguard Worker DrawElementsType type,
275*8975f5c5SAndroid Build Coastguard Worker const void *indices,
276*8975f5c5SAndroid Build Coastguard Worker GLsizei instancecount,
277*8975f5c5SAndroid Build Coastguard Worker GLint basevertex)
278*8975f5c5SAndroid Build Coastguard Worker {
279*8975f5c5SAndroid Build Coastguard Worker return ValidateDrawElementsInstancedBase(context, entryPoint, mode, count, type, indices,
280*8975f5c5SAndroid Build Coastguard Worker instancecount, 0);
281*8975f5c5SAndroid Build Coastguard Worker }
282*8975f5c5SAndroid Build Coastguard Worker
ValidateDrawRangeElementsBaseVertex(const Context * context,angle::EntryPoint entryPoint,PrimitiveMode mode,GLuint start,GLuint end,GLsizei count,DrawElementsType type,const void * indices,GLint basevertex)283*8975f5c5SAndroid Build Coastguard Worker bool ValidateDrawRangeElementsBaseVertex(const Context *context,
284*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
285*8975f5c5SAndroid Build Coastguard Worker PrimitiveMode mode,
286*8975f5c5SAndroid Build Coastguard Worker GLuint start,
287*8975f5c5SAndroid Build Coastguard Worker GLuint end,
288*8975f5c5SAndroid Build Coastguard Worker GLsizei count,
289*8975f5c5SAndroid Build Coastguard Worker DrawElementsType type,
290*8975f5c5SAndroid Build Coastguard Worker const void *indices,
291*8975f5c5SAndroid Build Coastguard Worker GLint basevertex)
292*8975f5c5SAndroid Build Coastguard Worker {
293*8975f5c5SAndroid Build Coastguard Worker if (end < start)
294*8975f5c5SAndroid Build Coastguard Worker {
295*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_VALUE, kInvalidElementRange);
296*8975f5c5SAndroid Build Coastguard Worker return false;
297*8975f5c5SAndroid Build Coastguard Worker }
298*8975f5c5SAndroid Build Coastguard Worker
299*8975f5c5SAndroid Build Coastguard Worker if (!ValidateDrawElementsCommon(context, entryPoint, mode, count, type, indices, 1))
300*8975f5c5SAndroid Build Coastguard Worker {
301*8975f5c5SAndroid Build Coastguard Worker return false;
302*8975f5c5SAndroid Build Coastguard Worker }
303*8975f5c5SAndroid Build Coastguard Worker
304*8975f5c5SAndroid Build Coastguard Worker // Skip range checks for no-op calls.
305*8975f5c5SAndroid Build Coastguard Worker if (count <= 0)
306*8975f5c5SAndroid Build Coastguard Worker {
307*8975f5c5SAndroid Build Coastguard Worker return true;
308*8975f5c5SAndroid Build Coastguard Worker }
309*8975f5c5SAndroid Build Coastguard Worker
310*8975f5c5SAndroid Build Coastguard Worker return true;
311*8975f5c5SAndroid Build Coastguard Worker }
312*8975f5c5SAndroid Build Coastguard Worker
ValidateEnablei(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLenum target,GLuint index)313*8975f5c5SAndroid Build Coastguard Worker bool ValidateEnablei(const PrivateState &state,
314*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
315*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
316*8975f5c5SAndroid Build Coastguard Worker GLenum target,
317*8975f5c5SAndroid Build Coastguard Worker GLuint index)
318*8975f5c5SAndroid Build Coastguard Worker {
319*8975f5c5SAndroid Build Coastguard Worker int numPLSPlanes = state.getPixelLocalStorageActivePlanes();
320*8975f5c5SAndroid Build Coastguard Worker if (numPLSPlanes != 0)
321*8975f5c5SAndroid Build Coastguard Worker {
322*8975f5c5SAndroid Build Coastguard Worker if (IsIndexedCapBannedWithActivePLS(target))
323*8975f5c5SAndroid Build Coastguard Worker {
324*8975f5c5SAndroid Build Coastguard Worker errors->validationErrorF(entryPoint, GL_INVALID_OPERATION, kPLSCapNotAllowed, target);
325*8975f5c5SAndroid Build Coastguard Worker return false;
326*8975f5c5SAndroid Build Coastguard Worker }
327*8975f5c5SAndroid Build Coastguard Worker }
328*8975f5c5SAndroid Build Coastguard Worker
329*8975f5c5SAndroid Build Coastguard Worker switch (target)
330*8975f5c5SAndroid Build Coastguard Worker {
331*8975f5c5SAndroid Build Coastguard Worker case GL_BLEND:
332*8975f5c5SAndroid Build Coastguard Worker if (index >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
333*8975f5c5SAndroid Build Coastguard Worker {
334*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kIndexExceedsMaxDrawBuffer);
335*8975f5c5SAndroid Build Coastguard Worker return false;
336*8975f5c5SAndroid Build Coastguard Worker }
337*8975f5c5SAndroid Build Coastguard Worker break;
338*8975f5c5SAndroid Build Coastguard Worker default:
339*8975f5c5SAndroid Build Coastguard Worker errors->validationErrorF(entryPoint, GL_INVALID_ENUM, kEnumNotSupported, target);
340*8975f5c5SAndroid Build Coastguard Worker return false;
341*8975f5c5SAndroid Build Coastguard Worker }
342*8975f5c5SAndroid Build Coastguard Worker return true;
343*8975f5c5SAndroid Build Coastguard Worker }
344*8975f5c5SAndroid Build Coastguard Worker
ValidateFramebufferTexture(const Context * context,angle::EntryPoint entryPoint,GLenum target,GLenum attachment,TextureID texture,GLint level)345*8975f5c5SAndroid Build Coastguard Worker bool ValidateFramebufferTexture(const Context *context,
346*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
347*8975f5c5SAndroid Build Coastguard Worker GLenum target,
348*8975f5c5SAndroid Build Coastguard Worker GLenum attachment,
349*8975f5c5SAndroid Build Coastguard Worker TextureID texture,
350*8975f5c5SAndroid Build Coastguard Worker GLint level)
351*8975f5c5SAndroid Build Coastguard Worker {
352*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
353*8975f5c5SAndroid Build Coastguard Worker {
354*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
355*8975f5c5SAndroid Build Coastguard Worker return false;
356*8975f5c5SAndroid Build Coastguard Worker }
357*8975f5c5SAndroid Build Coastguard Worker
358*8975f5c5SAndroid Build Coastguard Worker return ValidateFramebufferTextureCommon(context, entryPoint, target, attachment, texture,
359*8975f5c5SAndroid Build Coastguard Worker level);
360*8975f5c5SAndroid Build Coastguard Worker }
361*8975f5c5SAndroid Build Coastguard Worker
ValidateGetDebugMessageLog(const Context * context,angle::EntryPoint entryPoint,GLuint count,GLsizei bufSize,const GLenum * sources,const GLenum * types,const GLuint * ids,const GLenum * severities,const GLsizei * lengths,const GLchar * messageLog)362*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetDebugMessageLog(const Context *context,
363*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
364*8975f5c5SAndroid Build Coastguard Worker GLuint count,
365*8975f5c5SAndroid Build Coastguard Worker GLsizei bufSize,
366*8975f5c5SAndroid Build Coastguard Worker const GLenum *sources,
367*8975f5c5SAndroid Build Coastguard Worker const GLenum *types,
368*8975f5c5SAndroid Build Coastguard Worker const GLuint *ids,
369*8975f5c5SAndroid Build Coastguard Worker const GLenum *severities,
370*8975f5c5SAndroid Build Coastguard Worker const GLsizei *lengths,
371*8975f5c5SAndroid Build Coastguard Worker const GLchar *messageLog)
372*8975f5c5SAndroid Build Coastguard Worker {
373*8975f5c5SAndroid Build Coastguard Worker return true;
374*8975f5c5SAndroid Build Coastguard Worker }
375*8975f5c5SAndroid Build Coastguard Worker
ValidateGetGraphicsResetStatus(const Context * context,angle::EntryPoint entryPoint)376*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetGraphicsResetStatus(const Context *context, angle::EntryPoint entryPoint)
377*8975f5c5SAndroid Build Coastguard Worker {
378*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
379*8975f5c5SAndroid Build Coastguard Worker {
380*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
381*8975f5c5SAndroid Build Coastguard Worker return false;
382*8975f5c5SAndroid Build Coastguard Worker }
383*8975f5c5SAndroid Build Coastguard Worker
384*8975f5c5SAndroid Build Coastguard Worker return true;
385*8975f5c5SAndroid Build Coastguard Worker }
386*8975f5c5SAndroid Build Coastguard Worker
ValidateGetObjectLabel(const Context * context,angle::EntryPoint entryPoint,GLenum identifier,GLuint name,GLsizei bufSize,const GLsizei * length,const GLchar * label)387*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetObjectLabel(const Context *context,
388*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
389*8975f5c5SAndroid Build Coastguard Worker GLenum identifier,
390*8975f5c5SAndroid Build Coastguard Worker GLuint name,
391*8975f5c5SAndroid Build Coastguard Worker GLsizei bufSize,
392*8975f5c5SAndroid Build Coastguard Worker const GLsizei *length,
393*8975f5c5SAndroid Build Coastguard Worker const GLchar *label)
394*8975f5c5SAndroid Build Coastguard Worker {
395*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
396*8975f5c5SAndroid Build Coastguard Worker {
397*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
398*8975f5c5SAndroid Build Coastguard Worker return false;
399*8975f5c5SAndroid Build Coastguard Worker }
400*8975f5c5SAndroid Build Coastguard Worker
401*8975f5c5SAndroid Build Coastguard Worker if (!ValidateGetObjectLabelBase(context, entryPoint, identifier, name, bufSize, length, label))
402*8975f5c5SAndroid Build Coastguard Worker {
403*8975f5c5SAndroid Build Coastguard Worker return false;
404*8975f5c5SAndroid Build Coastguard Worker }
405*8975f5c5SAndroid Build Coastguard Worker
406*8975f5c5SAndroid Build Coastguard Worker return true;
407*8975f5c5SAndroid Build Coastguard Worker }
408*8975f5c5SAndroid Build Coastguard Worker
ValidateGetObjectPtrLabel(const Context * context,angle::EntryPoint entryPoint,const void * ptr,GLsizei bufSize,const GLsizei * length,const GLchar * label)409*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetObjectPtrLabel(const Context *context,
410*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
411*8975f5c5SAndroid Build Coastguard Worker const void *ptr,
412*8975f5c5SAndroid Build Coastguard Worker GLsizei bufSize,
413*8975f5c5SAndroid Build Coastguard Worker const GLsizei *length,
414*8975f5c5SAndroid Build Coastguard Worker const GLchar *label)
415*8975f5c5SAndroid Build Coastguard Worker {
416*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
417*8975f5c5SAndroid Build Coastguard Worker {
418*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
419*8975f5c5SAndroid Build Coastguard Worker return false;
420*8975f5c5SAndroid Build Coastguard Worker }
421*8975f5c5SAndroid Build Coastguard Worker
422*8975f5c5SAndroid Build Coastguard Worker if (!ValidateGetObjectPtrLabelBase(context, entryPoint, ptr, bufSize, length, label))
423*8975f5c5SAndroid Build Coastguard Worker {
424*8975f5c5SAndroid Build Coastguard Worker return false;
425*8975f5c5SAndroid Build Coastguard Worker }
426*8975f5c5SAndroid Build Coastguard Worker
427*8975f5c5SAndroid Build Coastguard Worker return true;
428*8975f5c5SAndroid Build Coastguard Worker }
429*8975f5c5SAndroid Build Coastguard Worker
ValidateGetPointerv(const Context * context,angle::EntryPoint entryPoint,GLenum pname,void * const * params)430*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetPointerv(const Context *context,
431*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
432*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
433*8975f5c5SAndroid Build Coastguard Worker void *const *params)
434*8975f5c5SAndroid Build Coastguard Worker {
435*8975f5c5SAndroid Build Coastguard Worker switch (pname)
436*8975f5c5SAndroid Build Coastguard Worker {
437*8975f5c5SAndroid Build Coastguard Worker case GL_VERTEX_ARRAY_POINTER:
438*8975f5c5SAndroid Build Coastguard Worker case GL_NORMAL_ARRAY_POINTER:
439*8975f5c5SAndroid Build Coastguard Worker case GL_COLOR_ARRAY_POINTER:
440*8975f5c5SAndroid Build Coastguard Worker case GL_TEXTURE_COORD_ARRAY_POINTER:
441*8975f5c5SAndroid Build Coastguard Worker case GL_POINT_SIZE_ARRAY_POINTER_OES:
442*8975f5c5SAndroid Build Coastguard Worker if (context->getClientMajorVersion() != 1)
443*8975f5c5SAndroid Build Coastguard Worker {
444*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_ENUM, kInvalidPointerQuery);
445*8975f5c5SAndroid Build Coastguard Worker return false;
446*8975f5c5SAndroid Build Coastguard Worker }
447*8975f5c5SAndroid Build Coastguard Worker break;
448*8975f5c5SAndroid Build Coastguard Worker
449*8975f5c5SAndroid Build Coastguard Worker case GL_DEBUG_CALLBACK_FUNCTION:
450*8975f5c5SAndroid Build Coastguard Worker case GL_DEBUG_CALLBACK_USER_PARAM:
451*8975f5c5SAndroid Build Coastguard Worker if (!context->getExtensions().debugKHR)
452*8975f5c5SAndroid Build Coastguard Worker {
453*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kExtensionNotEnabled);
454*8975f5c5SAndroid Build Coastguard Worker return false;
455*8975f5c5SAndroid Build Coastguard Worker }
456*8975f5c5SAndroid Build Coastguard Worker break;
457*8975f5c5SAndroid Build Coastguard Worker
458*8975f5c5SAndroid Build Coastguard Worker case GL_BLOB_CACHE_GET_FUNCTION_ANGLE:
459*8975f5c5SAndroid Build Coastguard Worker case GL_BLOB_CACHE_SET_FUNCTION_ANGLE:
460*8975f5c5SAndroid Build Coastguard Worker case GL_BLOB_CACHE_USER_PARAM_ANGLE:
461*8975f5c5SAndroid Build Coastguard Worker if (!context->getExtensions().blobCacheANGLE)
462*8975f5c5SAndroid Build Coastguard Worker {
463*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kExtensionNotEnabled);
464*8975f5c5SAndroid Build Coastguard Worker return false;
465*8975f5c5SAndroid Build Coastguard Worker }
466*8975f5c5SAndroid Build Coastguard Worker break;
467*8975f5c5SAndroid Build Coastguard Worker
468*8975f5c5SAndroid Build Coastguard Worker default:
469*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_ENUM, kInvalidPointerQuery);
470*8975f5c5SAndroid Build Coastguard Worker return false;
471*8975f5c5SAndroid Build Coastguard Worker }
472*8975f5c5SAndroid Build Coastguard Worker
473*8975f5c5SAndroid Build Coastguard Worker return true;
474*8975f5c5SAndroid Build Coastguard Worker }
475*8975f5c5SAndroid Build Coastguard Worker
ValidateGetSamplerParameterIiv(const Context * context,angle::EntryPoint entryPoint,SamplerID sampler,GLenum pname,const GLint * params)476*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetSamplerParameterIiv(const Context *context,
477*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
478*8975f5c5SAndroid Build Coastguard Worker SamplerID sampler,
479*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
480*8975f5c5SAndroid Build Coastguard Worker const GLint *params)
481*8975f5c5SAndroid Build Coastguard Worker {
482*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
483*8975f5c5SAndroid Build Coastguard Worker {
484*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
485*8975f5c5SAndroid Build Coastguard Worker return false;
486*8975f5c5SAndroid Build Coastguard Worker }
487*8975f5c5SAndroid Build Coastguard Worker return ValidateGetSamplerParameterBase(context, entryPoint, sampler, pname, nullptr);
488*8975f5c5SAndroid Build Coastguard Worker }
489*8975f5c5SAndroid Build Coastguard Worker
ValidateGetSamplerParameterIuiv(const Context * context,angle::EntryPoint entryPoint,SamplerID sampler,GLenum pname,const GLuint * params)490*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetSamplerParameterIuiv(const Context *context,
491*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
492*8975f5c5SAndroid Build Coastguard Worker SamplerID sampler,
493*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
494*8975f5c5SAndroid Build Coastguard Worker const GLuint *params)
495*8975f5c5SAndroid Build Coastguard Worker {
496*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
497*8975f5c5SAndroid Build Coastguard Worker {
498*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
499*8975f5c5SAndroid Build Coastguard Worker return false;
500*8975f5c5SAndroid Build Coastguard Worker }
501*8975f5c5SAndroid Build Coastguard Worker return ValidateGetSamplerParameterBase(context, entryPoint, sampler, pname, nullptr);
502*8975f5c5SAndroid Build Coastguard Worker }
503*8975f5c5SAndroid Build Coastguard Worker
ValidateGetTexParameterIiv(const Context * context,angle::EntryPoint entryPoint,TextureType targetPacked,GLenum pname,const GLint * params)504*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetTexParameterIiv(const Context *context,
505*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
506*8975f5c5SAndroid Build Coastguard Worker TextureType targetPacked,
507*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
508*8975f5c5SAndroid Build Coastguard Worker const GLint *params)
509*8975f5c5SAndroid Build Coastguard Worker {
510*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
511*8975f5c5SAndroid Build Coastguard Worker {
512*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
513*8975f5c5SAndroid Build Coastguard Worker return false;
514*8975f5c5SAndroid Build Coastguard Worker }
515*8975f5c5SAndroid Build Coastguard Worker return ValidateGetTexParameterBase(context, entryPoint, targetPacked, pname, nullptr);
516*8975f5c5SAndroid Build Coastguard Worker }
517*8975f5c5SAndroid Build Coastguard Worker
ValidateGetTexParameterIuiv(const Context * context,angle::EntryPoint entryPoint,TextureType targetPacked,GLenum pname,const GLuint * params)518*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetTexParameterIuiv(const Context *context,
519*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
520*8975f5c5SAndroid Build Coastguard Worker TextureType targetPacked,
521*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
522*8975f5c5SAndroid Build Coastguard Worker const GLuint *params)
523*8975f5c5SAndroid Build Coastguard Worker {
524*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
525*8975f5c5SAndroid Build Coastguard Worker {
526*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
527*8975f5c5SAndroid Build Coastguard Worker return false;
528*8975f5c5SAndroid Build Coastguard Worker }
529*8975f5c5SAndroid Build Coastguard Worker return ValidateGetTexParameterBase(context, entryPoint, targetPacked, pname, nullptr);
530*8975f5c5SAndroid Build Coastguard Worker }
531*8975f5c5SAndroid Build Coastguard Worker
ValidateGetnUniformfv(const Context * context,angle::EntryPoint entryPoint,ShaderProgramID program,UniformLocation location,GLsizei bufSize,const GLfloat * params)532*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetnUniformfv(const Context *context,
533*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
534*8975f5c5SAndroid Build Coastguard Worker ShaderProgramID program,
535*8975f5c5SAndroid Build Coastguard Worker UniformLocation location,
536*8975f5c5SAndroid Build Coastguard Worker GLsizei bufSize,
537*8975f5c5SAndroid Build Coastguard Worker const GLfloat *params)
538*8975f5c5SAndroid Build Coastguard Worker {
539*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
540*8975f5c5SAndroid Build Coastguard Worker {
541*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
542*8975f5c5SAndroid Build Coastguard Worker return false;
543*8975f5c5SAndroid Build Coastguard Worker }
544*8975f5c5SAndroid Build Coastguard Worker
545*8975f5c5SAndroid Build Coastguard Worker return ValidateSizedGetUniform(context, entryPoint, program, location, bufSize, nullptr);
546*8975f5c5SAndroid Build Coastguard Worker }
547*8975f5c5SAndroid Build Coastguard Worker
ValidateGetnUniformiv(const Context * context,angle::EntryPoint entryPoint,ShaderProgramID program,UniformLocation location,GLsizei bufSize,const GLint * params)548*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetnUniformiv(const Context *context,
549*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
550*8975f5c5SAndroid Build Coastguard Worker ShaderProgramID program,
551*8975f5c5SAndroid Build Coastguard Worker UniformLocation location,
552*8975f5c5SAndroid Build Coastguard Worker GLsizei bufSize,
553*8975f5c5SAndroid Build Coastguard Worker const GLint *params)
554*8975f5c5SAndroid Build Coastguard Worker {
555*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
556*8975f5c5SAndroid Build Coastguard Worker {
557*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
558*8975f5c5SAndroid Build Coastguard Worker return false;
559*8975f5c5SAndroid Build Coastguard Worker }
560*8975f5c5SAndroid Build Coastguard Worker
561*8975f5c5SAndroid Build Coastguard Worker return ValidateSizedGetUniform(context, entryPoint, program, location, bufSize, nullptr);
562*8975f5c5SAndroid Build Coastguard Worker }
563*8975f5c5SAndroid Build Coastguard Worker
ValidateGetnUniformuiv(const Context * context,angle::EntryPoint entryPoint,ShaderProgramID program,UniformLocation location,GLsizei bufSize,const GLuint * params)564*8975f5c5SAndroid Build Coastguard Worker bool ValidateGetnUniformuiv(const Context *context,
565*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
566*8975f5c5SAndroid Build Coastguard Worker ShaderProgramID program,
567*8975f5c5SAndroid Build Coastguard Worker UniformLocation location,
568*8975f5c5SAndroid Build Coastguard Worker GLsizei bufSize,
569*8975f5c5SAndroid Build Coastguard Worker const GLuint *params)
570*8975f5c5SAndroid Build Coastguard Worker {
571*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
572*8975f5c5SAndroid Build Coastguard Worker {
573*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
574*8975f5c5SAndroid Build Coastguard Worker return false;
575*8975f5c5SAndroid Build Coastguard Worker }
576*8975f5c5SAndroid Build Coastguard Worker
577*8975f5c5SAndroid Build Coastguard Worker return ValidateSizedGetUniform(context, entryPoint, program, location, bufSize, nullptr);
578*8975f5c5SAndroid Build Coastguard Worker }
579*8975f5c5SAndroid Build Coastguard Worker
ValidateIsEnabledi(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLenum target,GLuint index)580*8975f5c5SAndroid Build Coastguard Worker bool ValidateIsEnabledi(const PrivateState &state,
581*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
582*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
583*8975f5c5SAndroid Build Coastguard Worker GLenum target,
584*8975f5c5SAndroid Build Coastguard Worker GLuint index)
585*8975f5c5SAndroid Build Coastguard Worker {
586*8975f5c5SAndroid Build Coastguard Worker switch (target)
587*8975f5c5SAndroid Build Coastguard Worker {
588*8975f5c5SAndroid Build Coastguard Worker case GL_BLEND:
589*8975f5c5SAndroid Build Coastguard Worker if (index >= static_cast<GLuint>(state.getCaps().maxDrawBuffers))
590*8975f5c5SAndroid Build Coastguard Worker {
591*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_VALUE, kIndexExceedsMaxDrawBuffer);
592*8975f5c5SAndroid Build Coastguard Worker return false;
593*8975f5c5SAndroid Build Coastguard Worker }
594*8975f5c5SAndroid Build Coastguard Worker break;
595*8975f5c5SAndroid Build Coastguard Worker default:
596*8975f5c5SAndroid Build Coastguard Worker errors->validationErrorF(entryPoint, GL_INVALID_ENUM, kEnumNotSupported, target);
597*8975f5c5SAndroid Build Coastguard Worker return false;
598*8975f5c5SAndroid Build Coastguard Worker }
599*8975f5c5SAndroid Build Coastguard Worker return true;
600*8975f5c5SAndroid Build Coastguard Worker }
601*8975f5c5SAndroid Build Coastguard Worker
ValidateMinSampleShading(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLfloat value)602*8975f5c5SAndroid Build Coastguard Worker bool ValidateMinSampleShading(const PrivateState &state,
603*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
604*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
605*8975f5c5SAndroid Build Coastguard Worker GLfloat value)
606*8975f5c5SAndroid Build Coastguard Worker {
607*8975f5c5SAndroid Build Coastguard Worker return true;
608*8975f5c5SAndroid Build Coastguard Worker }
609*8975f5c5SAndroid Build Coastguard Worker
ValidateObjectLabel(const Context * context,angle::EntryPoint entryPoint,GLenum identifier,GLuint name,GLsizei length,const GLchar * label)610*8975f5c5SAndroid Build Coastguard Worker bool ValidateObjectLabel(const Context *context,
611*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
612*8975f5c5SAndroid Build Coastguard Worker GLenum identifier,
613*8975f5c5SAndroid Build Coastguard Worker GLuint name,
614*8975f5c5SAndroid Build Coastguard Worker GLsizei length,
615*8975f5c5SAndroid Build Coastguard Worker const GLchar *label)
616*8975f5c5SAndroid Build Coastguard Worker {
617*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
618*8975f5c5SAndroid Build Coastguard Worker {
619*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
620*8975f5c5SAndroid Build Coastguard Worker return false;
621*8975f5c5SAndroid Build Coastguard Worker }
622*8975f5c5SAndroid Build Coastguard Worker
623*8975f5c5SAndroid Build Coastguard Worker if (!ValidateObjectLabelBase(context, entryPoint, identifier, name, length, label))
624*8975f5c5SAndroid Build Coastguard Worker {
625*8975f5c5SAndroid Build Coastguard Worker return false;
626*8975f5c5SAndroid Build Coastguard Worker }
627*8975f5c5SAndroid Build Coastguard Worker
628*8975f5c5SAndroid Build Coastguard Worker return true;
629*8975f5c5SAndroid Build Coastguard Worker }
630*8975f5c5SAndroid Build Coastguard Worker
ValidateObjectPtrLabel(const Context * context,angle::EntryPoint entryPoint,const void * ptr,GLsizei length,const GLchar * label)631*8975f5c5SAndroid Build Coastguard Worker bool ValidateObjectPtrLabel(const Context *context,
632*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
633*8975f5c5SAndroid Build Coastguard Worker const void *ptr,
634*8975f5c5SAndroid Build Coastguard Worker GLsizei length,
635*8975f5c5SAndroid Build Coastguard Worker const GLchar *label)
636*8975f5c5SAndroid Build Coastguard Worker {
637*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
638*8975f5c5SAndroid Build Coastguard Worker {
639*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
640*8975f5c5SAndroid Build Coastguard Worker return false;
641*8975f5c5SAndroid Build Coastguard Worker }
642*8975f5c5SAndroid Build Coastguard Worker
643*8975f5c5SAndroid Build Coastguard Worker if (!ValidateObjectPtrLabelBase(context, entryPoint, ptr, length, label))
644*8975f5c5SAndroid Build Coastguard Worker {
645*8975f5c5SAndroid Build Coastguard Worker return false;
646*8975f5c5SAndroid Build Coastguard Worker }
647*8975f5c5SAndroid Build Coastguard Worker
648*8975f5c5SAndroid Build Coastguard Worker return true;
649*8975f5c5SAndroid Build Coastguard Worker }
650*8975f5c5SAndroid Build Coastguard Worker
ValidatePatchParameteri(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLenum pname,GLint value)651*8975f5c5SAndroid Build Coastguard Worker bool ValidatePatchParameteri(const PrivateState &state,
652*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
653*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
654*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
655*8975f5c5SAndroid Build Coastguard Worker GLint value)
656*8975f5c5SAndroid Build Coastguard Worker {
657*8975f5c5SAndroid Build Coastguard Worker if (state.getClientVersion() < ES_3_2)
658*8975f5c5SAndroid Build Coastguard Worker {
659*8975f5c5SAndroid Build Coastguard Worker errors->validationError(entryPoint, GL_INVALID_OPERATION, kES32Required);
660*8975f5c5SAndroid Build Coastguard Worker return false;
661*8975f5c5SAndroid Build Coastguard Worker }
662*8975f5c5SAndroid Build Coastguard Worker
663*8975f5c5SAndroid Build Coastguard Worker return ValidatePatchParameteriBase(state, errors, entryPoint, pname, value);
664*8975f5c5SAndroid Build Coastguard Worker }
665*8975f5c5SAndroid Build Coastguard Worker
ValidatePopDebugGroup(const Context * context,angle::EntryPoint entryPoint)666*8975f5c5SAndroid Build Coastguard Worker bool ValidatePopDebugGroup(const Context *context, angle::EntryPoint entryPoint)
667*8975f5c5SAndroid Build Coastguard Worker {
668*8975f5c5SAndroid Build Coastguard Worker return ValidatePopDebugGroupBase(context, entryPoint);
669*8975f5c5SAndroid Build Coastguard Worker }
670*8975f5c5SAndroid Build Coastguard Worker
ValidatePrimitiveBoundingBox(const PrivateState & state,ErrorSet * errors,angle::EntryPoint entryPoint,GLfloat minX,GLfloat minY,GLfloat minZ,GLfloat minW,GLfloat maxX,GLfloat maxY,GLfloat maxZ,GLfloat maxW)671*8975f5c5SAndroid Build Coastguard Worker bool ValidatePrimitiveBoundingBox(const PrivateState &state,
672*8975f5c5SAndroid Build Coastguard Worker ErrorSet *errors,
673*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
674*8975f5c5SAndroid Build Coastguard Worker GLfloat minX,
675*8975f5c5SAndroid Build Coastguard Worker GLfloat minY,
676*8975f5c5SAndroid Build Coastguard Worker GLfloat minZ,
677*8975f5c5SAndroid Build Coastguard Worker GLfloat minW,
678*8975f5c5SAndroid Build Coastguard Worker GLfloat maxX,
679*8975f5c5SAndroid Build Coastguard Worker GLfloat maxY,
680*8975f5c5SAndroid Build Coastguard Worker GLfloat maxZ,
681*8975f5c5SAndroid Build Coastguard Worker GLfloat maxW)
682*8975f5c5SAndroid Build Coastguard Worker {
683*8975f5c5SAndroid Build Coastguard Worker return true;
684*8975f5c5SAndroid Build Coastguard Worker }
685*8975f5c5SAndroid Build Coastguard Worker
ValidatePushDebugGroup(const Context * context,angle::EntryPoint entryPoint,GLenum source,GLuint id,GLsizei length,const GLchar * message)686*8975f5c5SAndroid Build Coastguard Worker bool ValidatePushDebugGroup(const Context *context,
687*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
688*8975f5c5SAndroid Build Coastguard Worker GLenum source,
689*8975f5c5SAndroid Build Coastguard Worker GLuint id,
690*8975f5c5SAndroid Build Coastguard Worker GLsizei length,
691*8975f5c5SAndroid Build Coastguard Worker const GLchar *message)
692*8975f5c5SAndroid Build Coastguard Worker {
693*8975f5c5SAndroid Build Coastguard Worker return ValidatePushDebugGroupBase(context, entryPoint, source, id, length, message);
694*8975f5c5SAndroid Build Coastguard Worker }
695*8975f5c5SAndroid Build Coastguard Worker
ValidateReadnPixels(const Context * context,angle::EntryPoint entryPoint,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,GLsizei bufSize,const void * data)696*8975f5c5SAndroid Build Coastguard Worker bool ValidateReadnPixels(const Context *context,
697*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
698*8975f5c5SAndroid Build Coastguard Worker GLint x,
699*8975f5c5SAndroid Build Coastguard Worker GLint y,
700*8975f5c5SAndroid Build Coastguard Worker GLsizei width,
701*8975f5c5SAndroid Build Coastguard Worker GLsizei height,
702*8975f5c5SAndroid Build Coastguard Worker GLenum format,
703*8975f5c5SAndroid Build Coastguard Worker GLenum type,
704*8975f5c5SAndroid Build Coastguard Worker GLsizei bufSize,
705*8975f5c5SAndroid Build Coastguard Worker const void *data)
706*8975f5c5SAndroid Build Coastguard Worker {
707*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
708*8975f5c5SAndroid Build Coastguard Worker {
709*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
710*8975f5c5SAndroid Build Coastguard Worker return false;
711*8975f5c5SAndroid Build Coastguard Worker }
712*8975f5c5SAndroid Build Coastguard Worker
713*8975f5c5SAndroid Build Coastguard Worker if (bufSize < 0)
714*8975f5c5SAndroid Build Coastguard Worker {
715*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_VALUE, kNegativeBufferSize);
716*8975f5c5SAndroid Build Coastguard Worker return false;
717*8975f5c5SAndroid Build Coastguard Worker }
718*8975f5c5SAndroid Build Coastguard Worker
719*8975f5c5SAndroid Build Coastguard Worker return ValidateReadPixelsBase(context, entryPoint, x, y, width, height, format, type, bufSize,
720*8975f5c5SAndroid Build Coastguard Worker nullptr, nullptr, nullptr, data);
721*8975f5c5SAndroid Build Coastguard Worker }
722*8975f5c5SAndroid Build Coastguard Worker
ValidateSamplerParameterIiv(const Context * context,angle::EntryPoint entryPoint,SamplerID sampler,GLenum pname,const GLint * param)723*8975f5c5SAndroid Build Coastguard Worker bool ValidateSamplerParameterIiv(const Context *context,
724*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
725*8975f5c5SAndroid Build Coastguard Worker SamplerID sampler,
726*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
727*8975f5c5SAndroid Build Coastguard Worker const GLint *param)
728*8975f5c5SAndroid Build Coastguard Worker {
729*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
730*8975f5c5SAndroid Build Coastguard Worker {
731*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
732*8975f5c5SAndroid Build Coastguard Worker return false;
733*8975f5c5SAndroid Build Coastguard Worker }
734*8975f5c5SAndroid Build Coastguard Worker return ValidateSamplerParameterBase(context, entryPoint, sampler, pname, -1, true, param);
735*8975f5c5SAndroid Build Coastguard Worker }
736*8975f5c5SAndroid Build Coastguard Worker
ValidateSamplerParameterIuiv(const Context * context,angle::EntryPoint entryPoint,SamplerID sampler,GLenum pname,const GLuint * param)737*8975f5c5SAndroid Build Coastguard Worker bool ValidateSamplerParameterIuiv(const Context *context,
738*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
739*8975f5c5SAndroid Build Coastguard Worker SamplerID sampler,
740*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
741*8975f5c5SAndroid Build Coastguard Worker const GLuint *param)
742*8975f5c5SAndroid Build Coastguard Worker {
743*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
744*8975f5c5SAndroid Build Coastguard Worker {
745*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
746*8975f5c5SAndroid Build Coastguard Worker return false;
747*8975f5c5SAndroid Build Coastguard Worker }
748*8975f5c5SAndroid Build Coastguard Worker return ValidateSamplerParameterBase(context, entryPoint, sampler, pname, -1, true, param);
749*8975f5c5SAndroid Build Coastguard Worker }
750*8975f5c5SAndroid Build Coastguard Worker
ValidateTexBuffer(const Context * context,angle::EntryPoint entryPoint,TextureType target,GLenum internalformat,BufferID buffer)751*8975f5c5SAndroid Build Coastguard Worker bool ValidateTexBuffer(const Context *context,
752*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
753*8975f5c5SAndroid Build Coastguard Worker TextureType target,
754*8975f5c5SAndroid Build Coastguard Worker GLenum internalformat,
755*8975f5c5SAndroid Build Coastguard Worker BufferID buffer)
756*8975f5c5SAndroid Build Coastguard Worker {
757*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
758*8975f5c5SAndroid Build Coastguard Worker {
759*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
760*8975f5c5SAndroid Build Coastguard Worker return false;
761*8975f5c5SAndroid Build Coastguard Worker }
762*8975f5c5SAndroid Build Coastguard Worker
763*8975f5c5SAndroid Build Coastguard Worker return ValidateTexBufferBase(context, entryPoint, target, internalformat, buffer);
764*8975f5c5SAndroid Build Coastguard Worker }
765*8975f5c5SAndroid Build Coastguard Worker
ValidateTexBufferRange(const Context * context,angle::EntryPoint entryPoint,TextureType target,GLenum internalformat,BufferID buffer,GLintptr offset,GLsizeiptr size)766*8975f5c5SAndroid Build Coastguard Worker bool ValidateTexBufferRange(const Context *context,
767*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
768*8975f5c5SAndroid Build Coastguard Worker TextureType target,
769*8975f5c5SAndroid Build Coastguard Worker GLenum internalformat,
770*8975f5c5SAndroid Build Coastguard Worker BufferID buffer,
771*8975f5c5SAndroid Build Coastguard Worker GLintptr offset,
772*8975f5c5SAndroid Build Coastguard Worker GLsizeiptr size)
773*8975f5c5SAndroid Build Coastguard Worker {
774*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
775*8975f5c5SAndroid Build Coastguard Worker {
776*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
777*8975f5c5SAndroid Build Coastguard Worker return false;
778*8975f5c5SAndroid Build Coastguard Worker }
779*8975f5c5SAndroid Build Coastguard Worker
780*8975f5c5SAndroid Build Coastguard Worker return ValidateTexBufferRangeBase(context, entryPoint, target, internalformat, buffer, offset,
781*8975f5c5SAndroid Build Coastguard Worker size);
782*8975f5c5SAndroid Build Coastguard Worker }
783*8975f5c5SAndroid Build Coastguard Worker
ValidateTexParameterIiv(const Context * context,angle::EntryPoint entryPoint,TextureType targetPacked,GLenum pname,const GLint * params)784*8975f5c5SAndroid Build Coastguard Worker bool ValidateTexParameterIiv(const Context *context,
785*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
786*8975f5c5SAndroid Build Coastguard Worker TextureType targetPacked,
787*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
788*8975f5c5SAndroid Build Coastguard Worker const GLint *params)
789*8975f5c5SAndroid Build Coastguard Worker {
790*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
791*8975f5c5SAndroid Build Coastguard Worker {
792*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
793*8975f5c5SAndroid Build Coastguard Worker return false;
794*8975f5c5SAndroid Build Coastguard Worker }
795*8975f5c5SAndroid Build Coastguard Worker return ValidateTexParameterBase(context, entryPoint, targetPacked, pname, -1, true, params);
796*8975f5c5SAndroid Build Coastguard Worker }
797*8975f5c5SAndroid Build Coastguard Worker
ValidateTexParameterIuiv(const Context * context,angle::EntryPoint entryPoint,TextureType targetPacked,GLenum pname,const GLuint * params)798*8975f5c5SAndroid Build Coastguard Worker bool ValidateTexParameterIuiv(const Context *context,
799*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
800*8975f5c5SAndroid Build Coastguard Worker TextureType targetPacked,
801*8975f5c5SAndroid Build Coastguard Worker GLenum pname,
802*8975f5c5SAndroid Build Coastguard Worker const GLuint *params)
803*8975f5c5SAndroid Build Coastguard Worker {
804*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
805*8975f5c5SAndroid Build Coastguard Worker {
806*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
807*8975f5c5SAndroid Build Coastguard Worker return false;
808*8975f5c5SAndroid Build Coastguard Worker }
809*8975f5c5SAndroid Build Coastguard Worker return ValidateTexParameterBase(context, entryPoint, targetPacked, pname, -1, true, params);
810*8975f5c5SAndroid Build Coastguard Worker }
811*8975f5c5SAndroid Build Coastguard Worker
ValidateTexStorage3DMultisample(const Context * context,angle::EntryPoint entryPoint,TextureType targetPacked,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLboolean fixedsamplelocations)812*8975f5c5SAndroid Build Coastguard Worker bool ValidateTexStorage3DMultisample(const Context *context,
813*8975f5c5SAndroid Build Coastguard Worker angle::EntryPoint entryPoint,
814*8975f5c5SAndroid Build Coastguard Worker TextureType targetPacked,
815*8975f5c5SAndroid Build Coastguard Worker GLsizei samples,
816*8975f5c5SAndroid Build Coastguard Worker GLenum internalformat,
817*8975f5c5SAndroid Build Coastguard Worker GLsizei width,
818*8975f5c5SAndroid Build Coastguard Worker GLsizei height,
819*8975f5c5SAndroid Build Coastguard Worker GLsizei depth,
820*8975f5c5SAndroid Build Coastguard Worker GLboolean fixedsamplelocations)
821*8975f5c5SAndroid Build Coastguard Worker {
822*8975f5c5SAndroid Build Coastguard Worker if (context->getClientVersion() < ES_3_2)
823*8975f5c5SAndroid Build Coastguard Worker {
824*8975f5c5SAndroid Build Coastguard Worker ANGLE_VALIDATION_ERROR(GL_INVALID_OPERATION, kES32Required);
825*8975f5c5SAndroid Build Coastguard Worker return false;
826*8975f5c5SAndroid Build Coastguard Worker }
827*8975f5c5SAndroid Build Coastguard Worker return ValidateTexStorage3DMultisampleBase(context, entryPoint, targetPacked, samples,
828*8975f5c5SAndroid Build Coastguard Worker internalformat, width, height, depth);
829*8975f5c5SAndroid Build Coastguard Worker }
830*8975f5c5SAndroid Build Coastguard Worker
831*8975f5c5SAndroid Build Coastguard Worker } // namespace gl
832