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