1/* 2* Copyright (C) 2016 The Android Open Source Project 3* 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 7* 8* http://www.apache.org/licenses/LICENSE-2.0 9* 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. 15*/ 16 17#ifndef GLES_VALIDATION_H 18#define GLES_VALIDATION_H 19 20#include <GLES2/gl2.h> 21#include <GLES2/gl2ext.h> 22#include <GLES2/gl2platform.h> 23 24#include <GLES3/gl3.h> 25#include <GLES3/gl31.h> 26 27#include "GL2Encoder.h" 28 29#include <string> 30 31namespace GLESv2Validation { 32 33extern GLbitfield allBufferMapAccessFlags; 34bool bufferTarget(GL2Encoder* ctx, GLenum target); 35bool bufferParam(GL2Encoder* ctx, GLenum param); 36 37bool pixelStoreParam(GL2Encoder* ctx, GLenum param); 38bool pixelStoreValue(GLenum param, GLint value); 39 40bool rboFormat(GL2Encoder* ctx, GLenum internalformat); 41 42bool framebufferTarget(GL2Encoder* ctx, GLenum target); 43bool framebufferAttachment(GL2Encoder* ctx, GLenum attachment); 44 45bool readPixelsFormat(GLenum format); 46bool readPixelsType(GLenum type); 47 48bool vertexAttribType(GL2Encoder* ctx, GLenum type); 49 50bool readPixelsFboFormatMatch(GLenum format, GLenum type, GLenum fboTexType); 51bool blitFramebufferFormat(GLenum readFormat, GLenum drawFormat); 52 53bool textureTarget(GL2Encoder* ctx, GLenum target); 54 55GLsizei compressedTexImageSize(GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); 56 57bool isCompressedFormat(GLenum internalformat); 58bool supportedCompressedFormat(GL2Encoder* ctx, GLenum internalformat); 59 60bool unsizedFormat(GLenum format); 61 62bool filterableTexFormat(GL2Encoder* ctx, GLenum internalformat); 63bool colorRenderableFormat(GL2Encoder* ctx, GLenum internalformat); 64bool depthRenderableFormat(GL2Encoder* ctx, GLenum internalformat); 65bool stencilRenderableFormat(GL2Encoder* ctx, GLenum internalformat); 66 67bool isCubeMapTarget(GLenum target); 68 69bool pixelType(GL2Encoder* ctx, GLenum type); 70bool pixelFormat(GL2Encoder* ctx, GLenum format); 71 72bool pixelInternalFormat(GLenum internalformat); 73 74bool shaderType(GL2Encoder* ctx, GLenum type); 75 76bool internalFormatTarget(GL2Encoder* ctx, GLenum target); 77 78std::string vertexAttribIndexRangeErrorMsg(GL2Encoder* ctx, GLuint index); 79 80} // namespace GLESv2Validation 81 82#endif 83