1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 // intentionally no include guard here.
9 #ifndef HANDLE_WEBGL_INTERNAL_FORMAT
10 #error This header is meant to be included by other files defining HANDLE_WEBGL_INTERNAL_FORMAT.
13 #define WEBGL_INTERNAL_FORMAT(effectiveinternalformat, unsizedinternalformat, \
15 HANDLE_WEBGL_INTERNAL_FORMAT(LOCAL_GL_##effectiveinternalformat, \
16 LOCAL_GL_##unsizedinternalformat, \
19 // OpenGL ES 3.0.3, Table 3.2
21 // Maps effective internal formats to (unsized internal format, type) pairs.
23 // Effective int. fmt. Unsized int. fmt. Type
24 WEBGL_INTERNAL_FORMAT(ALPHA8
, ALPHA
, UNSIGNED_BYTE
)
25 WEBGL_INTERNAL_FORMAT(LUMINANCE8
, LUMINANCE
, UNSIGNED_BYTE
)
26 WEBGL_INTERNAL_FORMAT(LUMINANCE8_ALPHA8
, LUMINANCE_ALPHA
, UNSIGNED_BYTE
)
27 WEBGL_INTERNAL_FORMAT(RGB8
, RGB
, UNSIGNED_BYTE
)
28 WEBGL_INTERNAL_FORMAT(RGBA4
, RGBA
, UNSIGNED_SHORT_4_4_4_4
)
29 WEBGL_INTERNAL_FORMAT(RGB5_A1
, RGBA
, UNSIGNED_SHORT_5_5_5_1
)
30 WEBGL_INTERNAL_FORMAT(RGBA8
, RGBA
, UNSIGNED_BYTE
)
31 WEBGL_INTERNAL_FORMAT(RGB10_A2
, RGBA
, UNSIGNED_INT_2_10_10_10_REV
)
32 WEBGL_INTERNAL_FORMAT(DEPTH_COMPONENT16
, DEPTH_COMPONENT
, UNSIGNED_SHORT
)
33 WEBGL_INTERNAL_FORMAT(DEPTH_COMPONENT24
, DEPTH_COMPONENT
, UNSIGNED_INT
)
34 WEBGL_INTERNAL_FORMAT(R8
, RED
, UNSIGNED_BYTE
)
35 WEBGL_INTERNAL_FORMAT(RG8
, RG
, UNSIGNED_BYTE
)
36 WEBGL_INTERNAL_FORMAT(R16F
, RED
, HALF_FLOAT
)
37 WEBGL_INTERNAL_FORMAT(R32F
, RED
, FLOAT
)
38 WEBGL_INTERNAL_FORMAT(RG16F
, RG
, HALF_FLOAT
)
39 WEBGL_INTERNAL_FORMAT(RG32F
, RG
, FLOAT
)
40 WEBGL_INTERNAL_FORMAT(R8I
, RED_INTEGER
, BYTE
)
41 WEBGL_INTERNAL_FORMAT(R8UI
, RED_INTEGER
, UNSIGNED_BYTE
)
42 WEBGL_INTERNAL_FORMAT(R16I
, RED_INTEGER
, SHORT
)
43 WEBGL_INTERNAL_FORMAT(R16UI
, RED_INTEGER
, UNSIGNED_SHORT
)
44 WEBGL_INTERNAL_FORMAT(R32I
, RED_INTEGER
, INT
)
45 WEBGL_INTERNAL_FORMAT(R32UI
, RED_INTEGER
, UNSIGNED_INT
)
46 WEBGL_INTERNAL_FORMAT(RG8I
, RG_INTEGER
, BYTE
)
47 WEBGL_INTERNAL_FORMAT(RG8UI
, RG_INTEGER
, UNSIGNED_BYTE
)
48 WEBGL_INTERNAL_FORMAT(RG16I
, RG_INTEGER
, SHORT
)
49 WEBGL_INTERNAL_FORMAT(RG16UI
, RG_INTEGER
, UNSIGNED_SHORT
)
50 WEBGL_INTERNAL_FORMAT(RG32I
, RG_INTEGER
, INT
)
51 WEBGL_INTERNAL_FORMAT(RG32UI
, RG_INTEGER
, UNSIGNED_INT
)
52 WEBGL_INTERNAL_FORMAT(RGBA32F
, RGBA
, FLOAT
)
53 WEBGL_INTERNAL_FORMAT(RGB32F
, RGB
, FLOAT
)
54 WEBGL_INTERNAL_FORMAT(ALPHA32F_EXT
, ALPHA
, FLOAT
)
55 WEBGL_INTERNAL_FORMAT(LUMINANCE32F_EXT
, LUMINANCE
, FLOAT
)
56 WEBGL_INTERNAL_FORMAT(LUMINANCE_ALPHA32F_EXT
, LUMINANCE_ALPHA
, FLOAT
)
57 WEBGL_INTERNAL_FORMAT(RGBA16F
, RGBA
, HALF_FLOAT
)
58 WEBGL_INTERNAL_FORMAT(RGB16F
, RGB
, HALF_FLOAT
)
59 WEBGL_INTERNAL_FORMAT(ALPHA16F_EXT
, ALPHA
, HALF_FLOAT
)
60 WEBGL_INTERNAL_FORMAT(LUMINANCE16F_EXT
, LUMINANCE
, HALF_FLOAT
)
61 WEBGL_INTERNAL_FORMAT(LUMINANCE_ALPHA16F_EXT
, LUMINANCE_ALPHA
, HALF_FLOAT
)
62 WEBGL_INTERNAL_FORMAT(DEPTH24_STENCIL8
, DEPTH_STENCIL
, UNSIGNED_INT_24_8
)
63 WEBGL_INTERNAL_FORMAT(R11F_G11F_B10F
, RGB
, UNSIGNED_INT_10F_11F_11F_REV
)
64 WEBGL_INTERNAL_FORMAT(RGB9_E5
, RGB
, UNSIGNED_INT_5_9_9_9_REV
)
65 WEBGL_INTERNAL_FORMAT(SRGB8
, SRGB
, UNSIGNED_BYTE
)
66 WEBGL_INTERNAL_FORMAT(SRGB8_ALPHA8
, SRGB_ALPHA
, UNSIGNED_BYTE
)
67 WEBGL_INTERNAL_FORMAT(DEPTH_COMPONENT32F
, DEPTH_COMPONENT
, FLOAT
)
68 WEBGL_INTERNAL_FORMAT(DEPTH32F_STENCIL8
, DEPTH_STENCIL
,
69 FLOAT_32_UNSIGNED_INT_24_8_REV
)
70 WEBGL_INTERNAL_FORMAT(RGB565
, RGB
, UNSIGNED_SHORT_5_6_5
)
71 WEBGL_INTERNAL_FORMAT(RGBA32UI
, RGBA_INTEGER
, UNSIGNED_INT
)
72 WEBGL_INTERNAL_FORMAT(RGB32UI
, RGB_INTEGER
, UNSIGNED_INT
)
73 WEBGL_INTERNAL_FORMAT(RGBA16UI
, RGBA_INTEGER
, UNSIGNED_SHORT
)
74 WEBGL_INTERNAL_FORMAT(RGB16UI
, RGB_INTEGER
, UNSIGNED_SHORT
)
75 WEBGL_INTERNAL_FORMAT(RGBA8UI
, RGBA_INTEGER
, UNSIGNED_BYTE
)
76 WEBGL_INTERNAL_FORMAT(RGB8UI
, RGB_INTEGER
, UNSIGNED_BYTE
)
77 WEBGL_INTERNAL_FORMAT(RGBA32I
, RGBA_INTEGER
, INT
)
78 WEBGL_INTERNAL_FORMAT(RGB32I
, RGB_INTEGER
, INT
)
79 WEBGL_INTERNAL_FORMAT(RGBA16I
, RGBA_INTEGER
, SHORT
)
80 WEBGL_INTERNAL_FORMAT(RGB16I
, RGB_INTEGER
, SHORT
)
81 WEBGL_INTERNAL_FORMAT(RGBA8I
, RGBA_INTEGER
, BYTE
)
82 WEBGL_INTERNAL_FORMAT(RGB8I
, RGB_INTEGER
, BYTE
)
83 WEBGL_INTERNAL_FORMAT(R8_SNORM
, RED
, BYTE
)
84 WEBGL_INTERNAL_FORMAT(RG8_SNORM
, RG
, BYTE
)
85 WEBGL_INTERNAL_FORMAT(RGB8_SNORM
, RGB
, BYTE
)
86 WEBGL_INTERNAL_FORMAT(RGBA8_SNORM
, RGBA
, BYTE
)
87 WEBGL_INTERNAL_FORMAT(RGB10_A2UI
, RGBA_INTEGER
, UNSIGNED_INT_2_10_10_10_REV
)
89 #undef WEBGL_INTERNAL_FORMAT
90 #undef HANDLE_WEBGL_INTERNAL_FORMAT