• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (c) 2013 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 // validationES.h: Validation functions for generic OpenGL ES entry point parameters
8 
9 #ifndef LIBGLESV2_VALIDATION_ES_H
10 #define LIBGLESV2_VALIDATION_ES_H
11 
12 #include "common/mathutil.h"
13 
14 #include <GLES2/gl2.h>
15 #include <GLES3/gl3.h>
16 
17 namespace gl
18 {
19 
20 class Context;
21 
22 bool ValidCap(const Context *context, GLenum cap);
23 bool ValidTextureTarget(const Context *context, GLenum target);
24 bool ValidTexture2DDestinationTarget(const Context *context, GLenum target);
25 bool ValidFramebufferTarget(GLenum target);
26 bool ValidBufferTarget(const Context *context, GLenum target);
27 bool ValidBufferParameter(const Context *context, GLenum pname);
28 bool ValidMipLevel(const Context *context, GLenum target, GLint level);
29 bool ValidImageSize(const Context *context, GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth);
30 bool ValidCompressedImageSize(const Context *context, GLenum internalFormat, GLsizei width, GLsizei height);
31 bool ValidQueryType(const Context *context, GLenum queryType);
32 bool ValidProgram(Context *context, GLuint id);
33 
34 bool ValidateAttachmentTarget(Context *context, GLenum attachment);
35 bool ValidateRenderbufferStorageParameters(Context *context, GLenum target, GLsizei samples,
36                                            GLenum internalformat, GLsizei width, GLsizei height,
37                                            bool angleExtension);
38 bool ValidateFramebufferRenderbufferParameters(Context *context, GLenum target, GLenum attachment,
39                                                GLenum renderbuffertarget, GLuint renderbuffer);
40 
41 bool ValidateBlitFramebufferParameters(Context *context, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
42                                        GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask,
43                                        GLenum filter, bool fromAngleExtension);
44 
45 bool ValidateGetVertexAttribParameters(Context *context, GLenum pname);
46 
47 bool ValidateTexParamParameters(Context *context, GLenum pname, GLint param);
48 
49 bool ValidateSamplerObjectParameter(Context *context, GLenum pname);
50 
51 bool ValidateReadPixelsParameters(Context *context, GLint x, GLint y, GLsizei width, GLsizei height,
52                                   GLenum format, GLenum type, GLsizei *bufSize, GLvoid *pixels);
53 
54 bool ValidateBeginQuery(Context *context, GLenum target, GLuint id);
55 bool ValidateEndQuery(Context *context, GLenum target);
56 
57 bool ValidateUniform(Context *context, GLenum uniformType, GLint location, GLsizei count);
58 bool ValidateUniformMatrix(Context *context, GLenum matrixType, GLint location, GLsizei count,
59                            GLboolean transpose);
60 
61 bool ValidateStateQuery(Context *context, GLenum pname, GLenum *nativeType, unsigned int *numParams);
62 
63 bool ValidateCopyTexImageParametersBase(Context* context, GLenum target, GLint level, GLenum internalformat, bool isSubImage,
64                                         GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height,
65                                         GLint border, GLenum *textureInternalFormatOut);
66 
67 bool ValidateDrawArrays(Context *context, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
68 bool ValidateDrawArraysInstanced(Context *context, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
69 bool ValidateDrawArraysInstancedANGLE(Context *context, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
70 
71 bool ValidateDrawElements(Context *context, GLenum mode, GLsizei count, GLenum type,
72                           const GLvoid* indices, GLsizei primcount, rx::RangeUI *indexRangeOut);
73 
74 bool ValidateDrawElementsInstanced(Context *context, GLenum mode, GLsizei count, GLenum type,
75                                    const GLvoid *indices, GLsizei primcount, rx::RangeUI *indexRangeOut);
76 bool ValidateDrawElementsInstancedANGLE(Context *context, GLenum mode, GLsizei count, GLenum type,
77                                         const GLvoid *indices, GLsizei primcount, rx::RangeUI *indexRangeOut);
78 
79 bool ValidateFramebufferTextureBase(Context *context, GLenum target, GLenum attachment,
80                                     GLuint texture, GLint level);
81 bool ValidateFramebufferTexture2D(Context *context, GLenum target, GLenum attachment,
82                                   GLenum textarget, GLuint texture, GLint level);
83 
84 bool ValidateGetUniformBase(Context *context, GLuint program, GLint location);
85 bool ValidateGetUniformfv(Context *context, GLuint program, GLint location, GLfloat* params);
86 bool ValidateGetUniformiv(Context *context, GLuint program, GLint location, GLint* params);
87 bool ValidateGetnUniformfvEXT(Context *context, GLuint program, GLint location, GLsizei bufSize, GLfloat* params);
88 bool ValidateGetnUniformivEXT(Context *context, GLuint program, GLint location, GLsizei bufSize, GLint* params);
89 
90 }
91 
92 #endif // LIBGLESV2_VALIDATION_ES_H
93