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 | |
Geoff Lang | fe28ca0 | 2013-06-04 10:10:48 -0400 | [diff] [blame] | 17 | #include "libGLESv2/angletypes.h" |
| 18 | |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 19 | typedef void (*MipGenerationFunction)(unsigned int sourceWidth, unsigned int sourceHeight, unsigned int sourceDepth, |
| 20 | const unsigned char *sourceData, int sourceRowPitch, int sourceDepthPitch, |
| 21 | unsigned char *destData, int destRowPitch, int destDepthPitch); |
| 22 | |
| 23 | typedef void (*LoadImageFunction)(int width, int height, int depth, |
| 24 | const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch, |
| 25 | void *output, unsigned int outputRowPitch, unsigned int outputDepthPitch); |
| 26 | |
Geoff Lang | fe28ca0 | 2013-06-04 10:10:48 -0400 | [diff] [blame] | 27 | typedef void (*ColorReadFunction)(const void *source, void *dest); |
| 28 | typedef void (*ColorWriteFunction)(const void *source, void *dest); |
| 29 | typedef void (*ColorCopyFunction)(const void *source, void *dest); |
| 30 | |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 31 | namespace rx |
| 32 | { |
| 33 | |
| 34 | class Renderer; |
| 35 | |
| 36 | } |
| 37 | |
| 38 | namespace gl |
| 39 | { |
| 40 | |
| 41 | class Context; |
| 42 | |
| 43 | bool IsValidInternalFormat(GLint internalFormat, const Context *context); |
| 44 | bool IsValidFormat(GLenum format, GLuint clientVersion); |
| 45 | bool IsValidType(GLenum type, GLuint clientVersion); |
| 46 | |
| 47 | bool IsValidFormatCombination(GLint internalFormat, GLenum format, GLenum type, GLuint clientVersion); |
shannonwoods@chromium.org | ffab47d | 2013-05-30 00:16:22 +0000 | [diff] [blame] | 48 | bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBufferInternalFormat, GLuint clientVersion); |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 49 | |
| 50 | bool IsSizedInternalFormat(GLint internalFormat, GLuint clientVersion); |
| 51 | GLint GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion); |
| 52 | |
| 53 | GLuint GetPixelBytes(GLint internalFormat, GLuint clientVersion); |
| 54 | GLuint GetAlphaBits(GLint internalFormat, GLuint clientVersion); |
| 55 | GLuint GetRedBits(GLint internalFormat, GLuint clientVersion); |
| 56 | GLuint GetGreenBits(GLint internalFormat, GLuint clientVersion); |
| 57 | GLuint GetBlueBits(GLint internalFormat, GLuint clientVersion); |
| 58 | GLuint GetLuminanceBits(GLint internalFormat, GLuint clientVersion); |
| 59 | GLuint GetDepthBits(GLint internalFormat, GLuint clientVersion); |
| 60 | GLuint GetStencilBits(GLint internalFormat, GLuint clientVersion); |
| 61 | |
Geoff Lang | f23eb28 | 2013-07-22 10:52:19 -0400 | [diff] [blame^] | 62 | GLuint GetTypeBytes(GLenum type); |
| 63 | bool IsSpecialInterpretationType(GLenum type); |
| 64 | |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 65 | GLenum GetFormat(GLint internalFormat, GLuint clientVersion); |
| 66 | GLenum GetType(GLint internalFormat, GLuint clientVersion); |
| 67 | |
shannonwoods@chromium.org | e19409b | 2013-05-30 00:16:15 +0000 | [diff] [blame] | 68 | bool IsNormalizedFixedPointFormat(GLint internalFormat, GLuint clientVersion); |
| 69 | bool IsIntegerFormat(GLint internalFormat, GLuint clientVersion); |
| 70 | bool IsSignedIntegerFormat(GLint internalFormat, GLuint clientVersion); |
| 71 | bool IsUnsignedIntegerFormat(GLint internalFormat, GLuint clientVersion); |
| 72 | bool IsFloatingPointFormat(GLint internalFormat, GLuint clientVersion); |
| 73 | |
shannonwoods@chromium.org | e81ea50 | 2013-05-30 00:16:53 +0000 | [diff] [blame] | 74 | bool IsSRGBFormat(GLint internalFormat, GLuint clientVersion); |
| 75 | |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 76 | bool IsColorRenderingSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 77 | bool IsColorRenderingSupported(GLint internalFormat, const Context *context); |
| 78 | bool IsTextureFilteringSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 79 | bool IsTextureFilteringSupported(GLint internalFormat, const Context *context); |
| 80 | bool IsDepthRenderingSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 81 | bool IsDepthRenderingSupported(GLint internalFormat, const Context *context); |
| 82 | bool IsStencilRenderingSupported(GLint internalFormat, const rx::Renderer *renderer); |
| 83 | bool IsStencilRenderingSupported(GLint internalFormat, const Context *context); |
| 84 | |
| 85 | GLuint GetRowPitch(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLint alignment); |
| 86 | GLuint GetDepthPitch(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height, GLint alignment); |
| 87 | GLuint GetBlockSize(GLint internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height); |
| 88 | |
| 89 | bool IsFormatCompressed(GLint internalFormat, GLuint clientVersion); |
| 90 | GLuint GetCompressedBlockWidth(GLint internalFormat, GLuint clientVersion); |
| 91 | GLuint GetCompressedBlockHeight(GLint internalFormat, GLuint clientVersion); |
| 92 | |
Geoff Lang | fe28ca0 | 2013-06-04 10:10:48 -0400 | [diff] [blame] | 93 | ColorWriteFunction GetColorWriteFunction(GLenum format, GLenum type, GLuint clientVersion); |
| 94 | |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | #endif LIBGLESV2_FORMATUTILS_H_ |