Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / libGLESv2 / validationES.h
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 namespace gl
13 {
14
15 class Context;
16
17 bool ValidCap(const Context *context, GLenum cap);
18 bool ValidTextureTarget(const Context *context, GLenum target);
19 bool ValidTexture2DDestinationTarget(const Context *context, GLenum target);
20 bool ValidFramebufferTarget(GLenum target);
21 bool ValidBufferTarget(const Context *context, GLenum target);
22 bool ValidBufferParameter(const Context *context, GLenum pname);
23 bool ValidMipLevel(const Context *context, GLenum target, GLint level);
24 bool ValidImageSize(const gl::Context *context, GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth);
25 bool ValidCompressedImageSize(const gl::Context *context, GLenum internalFormat, GLsizei width, GLsizei height);
26 bool ValidQueryType(const gl::Context *context, GLenum queryType);
27 bool ValidProgram(const gl::Context *context, GLuint id);
28
29 bool ValidateAttachmentTarget(const gl::Context *context, GLenum attachment);
30 bool ValidateRenderbufferStorageParameters(const gl::Context *context, GLenum target, GLsizei samples,
31                                            GLenum internalformat, GLsizei width, GLsizei height,
32                                            bool angleExtension);
33 bool ValidateFramebufferRenderbufferParameters(gl::Context *context, GLenum target, GLenum attachment,
34                                                GLenum renderbuffertarget, GLuint renderbuffer);
35
36 bool ValidateBlitFramebufferParameters(gl::Context *context, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
37                                        GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask,
38                                        GLenum filter, bool fromAngleExtension);
39
40 bool ValidateGetVertexAttribParameters(GLenum pname, int clientVersion);
41
42 bool ValidateTexParamParameters(gl::Context *context, GLenum pname, GLint param);
43
44 bool ValidateSamplerObjectParameter(GLenum pname);
45
46 bool ValidateReadPixelsParameters(gl::Context *context, GLint x, GLint y, GLsizei width, GLsizei height,
47                                   GLenum format, GLenum type, GLsizei *bufSize, GLvoid *pixels);
48
49 bool ValidateBeginQuery(gl::Context *context, GLenum target, GLuint id);
50 bool ValidateEndQuery(gl::Context *context, GLenum target);
51
52 bool ValidateUniform(gl::Context *context, GLenum uniformType, GLint location, GLsizei count);
53 bool ValidateUniformMatrix(gl::Context *context, GLenum matrixType, GLint location, GLsizei count,
54                            GLboolean transpose);
55
56 bool ValidateStateQuery(gl::Context *context, GLenum pname, GLenum *nativeType, unsigned int *numParams);
57
58 bool ValidateCopyTexImageParametersBase(gl::Context* context, GLenum target, GLint level, GLenum internalformat, bool isSubImage,
59                                         GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height,
60                                         GLint border, GLenum *textureInternalFormatOut);
61
62 bool ValidateDrawArrays(const gl::Context *context, GLenum mode, GLint first, GLsizei count);
63 bool ValidateDrawArraysInstanced(const gl::Context *context, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
64 bool ValidateDrawElements(const gl::Context *context, GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
65 bool ValidateDrawElementsInstanced(const gl::Context *context, GLenum mode, GLsizei count, GLenum type,
66                                    const GLvoid *indices, GLsizei primcount);
67
68 bool ValidateFramebufferTextureBase(const gl::Context *context, GLenum target, GLenum attachment,
69                                     GLuint texture, GLint level);
70 bool ValidateFramebufferTexture2D(const gl::Context *context, GLenum target, GLenum attachment,
71                                   GLenum textarget, GLuint texture, GLint level);
72
73 }
74
75 #endif // LIBGLESV2_VALIDATION_ES_H