shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 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 | // formatutils.h: Queries for GL image formats. |
| 8 | |
| 9 | #ifndef LIBGLESV2_FORMATUTILS_H_ |
| 10 | #define LIBGLESV2_FORMATUTILS_H_ |
| 11 | |
| 12 | #define GL_APICALL |
| 13 | #include <GLES3/gl3.h> |
| 14 | #include <GLES2/gl2.h> |
| 15 | #include <GLES2/gl2ext.h> |
| 16 | |
| 17 | typedef void (*MipGenerationFunction)(unsigned int sourceWidth, unsigned int sourceHeight, unsigned int sourceDepth, |
| 18 | const unsigned char *sourceData, int sourceRowPitch, int sourceDepthPitch, |
| 19 | unsigned char *destData, int destRowPitch, int destDepthPitch); |
| 20 | |
| 21 | typedef void (*LoadImageFunction)(int width, int height, int depth, |
| 22 | const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch, |
| 23 | void *output, unsigned int outputRowPitch, unsigned int outputDepthPitch); |
| 24 | |
| 25 | namespace rx |
| 26 | { |
| 27 | |
| 28 | class Renderer; |
| 29 | |
| 30 | } |
| 31 | |
| 32 | namespace gl |
| 33 | { |
| 34 | |
| 35 | class Context; |
| 36 | |
| 37 | bool IsValidInternalFormat(GLint internalFormat, const Context *context); |
| 38 | bool IsValidFormat(GLenum format, GLuint clientVersion); |
| 39 | bool IsValidType(GLenum type, GLuint clientVersion); |
| 40 | |
| 41 | bool IsValidFormatCombination(GLint internalFormat, GLenum format, GLenum type, GLuint clientVersion); |
shannonwoods@chromium.org | ffab47d | 2013-05-30 00:16:22 +0000 | [diff] [blame] | 42 | bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBufferInternalFormat, GLuint clientVersion); |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 43 | |
| 44 | bool IsSizedInternalFormat(GLint internalFormat, GLuint clientVersion); |
| 45 | GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion); |
| 46 | |
| 47 | GLuint GetPixelBytes(GLint internalFormat, GLuint clientVersion); |
| 48 | GLuint GetAlphaBits(GLint internalFormat, GLuint clientVersion); |
| 49 | GLuint GetRedBits(GLint internalFormat, GLuint clientVersion); |
| 50 | GLuint GetGreenBits(GLint internalFormat, GLuint clientVersion); |
| 51 | GLuint GetBlueBits(GLint internalFormat, GLuint clientVersion); |
| 52 | GLuint GetLuminanceBits(GLint internalFormat, GLuint clientVersion); |
| 53 | GLuint GetDepthBits(GLint internalFormat, GLuint clientVersion); |
| 54 | GLuint GetStencilBits(GLint internalFormat, GLuint clientVersion); |
| 55 | |
| 56 | GLenum GetFormat(GLint internalFormat, GLuint clientVersion); |
| 57 | GLenum GetType(GLint internalFormat, GLuint clientVersion); |
| 58 | |
shannonwoods@chromium.org | e19409b | 2013-05-30 00:16:15 +0000 | [diff] [blame] | 59 | bool IsNormalizedFixedPointFormat(GLint internalFormat, GLuint clientVersion); |
| 60 | bool IsIntegerFormat(GLint internalFormat, GLuint clientVersion); |
| 61 | bool IsSignedIntegerFormat(GLint internalFormat, GLuint clientVersion); |
| 62 | bool IsUnsignedIntegerFormat(GLint internalFormat, GLuint clientVersion); |
| 63 | bool IsFloatingPointFormat(GLint internalFormat, GLuint clientVersion); |
| 64 | |
shannonwoods@chromium.org | e81ea50 | 2013-05-30 00:16:53 +0000 | [diff] [blame^] | 65 | bool IsSRGBFormat(GLint internalFormat, GLuint clientVersion); |
| 66 | |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 67 | bool IsColorRenderingSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 68 | bool IsColorRenderingSupported(GLint internalFormat, const Context *context); |
| 69 | bool IsTextureFilteringSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 70 | bool IsTextureFilteringSupported(GLint internalFormat, const Context *context); |
| 71 | bool IsDepthRenderingSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 72 | bool IsDepthRenderingSupported(GLint internalFormat, const Context *context); |
| 73 | bool IsStencilRenderingSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 74 | bool IsStencilRenderingSupported(GLint internalFormat, const Context *context); |
| 75 | |
| 76 | GLuint GetRowPitch(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLint alignment); |
| 77 | GLuint GetDepthPitch(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height, GLint alignment); |
| 78 | GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height); |
| 79 | |
| 80 | bool IsFormatCompressed(GLint internalFormat, GLuint clientVersion); |
| 81 | GLuint GetCompressedBlockWidth(GLint internalFormat, GLuint clientVersion); |
| 82 | GLuint GetCompressedBlockHeight(GLint internalFormat, GLuint clientVersion); |
| 83 | |
| 84 | } |
| 85 | |
| 86 | #endif LIBGLESV2_FORMATUTILS_H_ |