2 * Copyright (C) 2016 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef GLES_VALIDATION_H
18 #define GLES_VALIDATION_H
20 #include <GLES2/gl2.h>
21 #include <GLES2/gl2ext.h>
22 #include <GLES2/gl2platform.h>
24 #include <GLES3/gl3.h>
25 #include <GLES3/gl31.h>
27 #include "GL2Encoder.h"
29 namespace GLESv2Validation {
31 extern GLbitfield allBufferMapAccessFlags;
32 bool bufferTarget(GL2Encoder* ctx, GLenum target);
33 bool bufferParam(GL2Encoder* ctx, GLenum param);
35 bool pixelStoreParam(GL2Encoder* ctx, GLenum param);
36 bool pixelStoreValue(GLenum param, GLint value);
38 bool rboFormat(GL2Encoder* ctx, GLenum internalformat);
40 bool framebufferTarget(GL2Encoder* ctx, GLenum target);
41 bool framebufferAttachment(GL2Encoder* ctx, GLenum attachment);
43 bool readPixelsFormat(GLenum format);
44 bool readPixelsType(GLenum type);
46 bool vertexAttribType(GL2Encoder* ctx, GLenum type);
48 bool readPixelsFboFormatMatch(GLenum format, GLenum type, GLenum fboTexType);
49 bool blitFramebufferFormat(GLenum readFormat, GLenum drawFormat);
51 bool textureTarget(GL2Encoder* ctx, GLenum target);
53 GLsizei compressedTexImageSize(GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
55 bool isCompressedFormat(GLenum internalformat);
56 bool supportedCompressedFormat(GL2Encoder* ctx, GLenum internalformat);
57 bool filterableTexFormat(GLenum internalformat);
58 bool unsizedFormat(GLenum format);
59 bool colorRenderableFormat(GLenum internalformat);
60 bool depthRenderableFormat(GLenum internalformat);
61 bool stencilRenderableFormat(GLenum internalformat);
63 bool isCubeMapTarget(GLenum target);
65 bool pixelType(GL2Encoder* ctx, GLenum type);
66 bool pixelFormat(GL2Encoder* ctx, GLenum format);
68 bool pixelInternalFormat(GLenum internalformat);
70 bool shaderType(GL2Encoder* ctx, GLenum type);
72 bool internalFormatTarget(GL2Encoder* ctx, GLenum target);
74 } // namespace GLESv2Validation