• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_uniform_type_table.py.
3 //
4 // Copyright 2017 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // Uniform type info table:
9 //   Metadata about a particular uniform format, indexed by GL type.
10 
11 #include <array>
12 #include "common/utilities.h"
13 
14 using namespace angle;
15 
16 namespace gl
17 {
18 
19 namespace
20 {
21 constexpr std::array<UniformTypeInfo, 77> kInfoTable = {
22     {{GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 0, 0, 0, 0, 0 * 0,
23       0 * 0, false, false, false},
24      {GL_BOOL, GL_BOOL, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
25       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, false},
26      {GL_BOOL_VEC2, GL_BOOL, GL_NONE, GL_NONE, GL_BOOL_VEC2, SamplerFormat::InvalidEnum, 1, 2, 2,
27       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 2, false, false, false},
28      {GL_BOOL_VEC3, GL_BOOL, GL_NONE, GL_NONE, GL_BOOL_VEC3, SamplerFormat::InvalidEnum, 1, 3, 3,
29       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 3, false, false, false},
30      {GL_BOOL_VEC4, GL_BOOL, GL_NONE, GL_NONE, GL_BOOL_VEC4, SamplerFormat::InvalidEnum, 1, 4, 4,
31       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 4, false, false, false},
32      {GL_FLOAT, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL, SamplerFormat::InvalidEnum, 1, 1, 1,
33       sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 1, false, false, false},
34      {GL_FLOAT_MAT2, GL_FLOAT, GL_NONE, GL_FLOAT_MAT2, GL_NONE, SamplerFormat::InvalidEnum, 2, 2, 4,
35       sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 4, false, true, false},
36      {GL_FLOAT_MAT2x3, GL_FLOAT, GL_NONE, GL_FLOAT_MAT3x2, GL_NONE, SamplerFormat::InvalidEnum, 3,
37       2, 6, sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 6, false, true, false},
38      {GL_FLOAT_MAT2x4, GL_FLOAT, GL_NONE, GL_FLOAT_MAT4x2, GL_NONE, SamplerFormat::InvalidEnum, 4,
39       2, 8, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 8, false, true, false},
40      {GL_FLOAT_MAT3, GL_FLOAT, GL_NONE, GL_FLOAT_MAT3, GL_NONE, SamplerFormat::InvalidEnum, 3, 3, 9,
41       sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 9, false, true, false},
42      {GL_FLOAT_MAT3x2, GL_FLOAT, GL_NONE, GL_FLOAT_MAT2x3, GL_NONE, SamplerFormat::InvalidEnum, 2,
43       3, 6, sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 6, false, true, false},
44      {GL_FLOAT_MAT3x4, GL_FLOAT, GL_NONE, GL_FLOAT_MAT4x3, GL_NONE, SamplerFormat::InvalidEnum, 4,
45       3, 12, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 12, false, true, false},
46      {GL_FLOAT_MAT4, GL_FLOAT, GL_NONE, GL_FLOAT_MAT4, GL_NONE, SamplerFormat::InvalidEnum, 4, 4,
47       16, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 16, false, true, false},
48      {GL_FLOAT_MAT4x2, GL_FLOAT, GL_NONE, GL_FLOAT_MAT2x4, GL_NONE, SamplerFormat::InvalidEnum, 2,
49       4, 8, sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 8, false, true, false},
50      {GL_FLOAT_MAT4x3, GL_FLOAT, GL_NONE, GL_FLOAT_MAT3x4, GL_NONE, SamplerFormat::InvalidEnum, 3,
51       4, 12, sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 12, false, true, false},
52      {GL_FLOAT_VEC2, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL_VEC2, SamplerFormat::InvalidEnum, 1, 2, 2,
53       sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 2, false, false, false},
54      {GL_FLOAT_VEC3, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL_VEC3, SamplerFormat::InvalidEnum, 1, 3, 3,
55       sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 3, false, false, false},
56      {GL_FLOAT_VEC4, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL_VEC4, SamplerFormat::InvalidEnum, 1, 4, 4,
57       sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 4, false, false, false},
58      {GL_IMAGE_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
59       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
60      {GL_IMAGE_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum,
61       1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
62      {GL_IMAGE_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
63       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
64      {GL_IMAGE_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1,
65       1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
66      {GL_IMAGE_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
67       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
68       false, false, true},
69      {GL_IMAGE_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1,
70       1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
71      {GL_INT, GL_INT, GL_NONE, GL_NONE, GL_BOOL, SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint),
72       sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, false},
73      {GL_INT_IMAGE_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
74       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
75      {GL_INT_IMAGE_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
76       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
77       false, false, true},
78      {GL_INT_IMAGE_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
79       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
80      {GL_INT_IMAGE_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum,
81       1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
82      {GL_INT_IMAGE_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
83       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
84       false, false, true},
85      {GL_INT_IMAGE_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum,
86       1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
87      {GL_INT_SAMPLER_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Signed, 1, 1, 1,
88       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
89      {GL_INT_SAMPLER_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE, SamplerFormat::Signed,
90       1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
91      {GL_INT_SAMPLER_2D_MULTISAMPLE, GL_INT, GL_TEXTURE_2D_MULTISAMPLE, GL_NONE, GL_NONE,
92       SamplerFormat::Signed, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
93       false, false},
94      {GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_INT, GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_NONE,
95       GL_NONE, SamplerFormat::Signed, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
96       true, false, false},
97      {GL_INT_SAMPLER_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::Signed, 1, 1, 1,
98       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
99      {GL_INT_SAMPLER_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::Signed, 1,
100       1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
101      {GL_INT_SAMPLER_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
102       SamplerFormat::Signed, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
103       false, false},
104      {GL_INT_SAMPLER_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::Signed, 1,
105       1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
106      {GL_INT_VEC2, GL_INT, GL_NONE, GL_NONE, GL_BOOL_VEC2, SamplerFormat::InvalidEnum, 1, 2, 2,
107       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 2, false, false, false},
108      {GL_INT_VEC3, GL_INT, GL_NONE, GL_NONE, GL_BOOL_VEC3, SamplerFormat::InvalidEnum, 1, 3, 3,
109       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 3, false, false, false},
110      {GL_INT_VEC4, GL_INT, GL_NONE, GL_NONE, GL_BOOL_VEC4, SamplerFormat::InvalidEnum, 1, 4, 4,
111       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 4, false, false, false},
112      {GL_SAMPLER_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
113       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
114      {GL_SAMPLER_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE, SamplerFormat::Float, 1,
115       1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
116      {GL_SAMPLER_2D_ARRAY_SHADOW, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
117       SamplerFormat::Shadow, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
118       false, false},
119      {GL_SAMPLER_2D_MULTISAMPLE, GL_INT, GL_TEXTURE_2D_MULTISAMPLE, GL_NONE, GL_NONE,
120       SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
121       false, false},
122      {GL_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_INT, GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_NONE, GL_NONE,
123       SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
124       false, false},
125      {GL_SAMPLER_2D_RECT_ANGLE, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1,
126       1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
127      {GL_SAMPLER_2D_SHADOW, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Shadow, 1, 1, 1,
128       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
129      {GL_SAMPLER_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
130       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
131      {GL_SAMPLER_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
132       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
133      {GL_SAMPLER_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
134       SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
135       false, false},
136      {GL_SAMPLER_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
137       sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
138      {GL_SAMPLER_CUBE_SHADOW, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::Shadow,
139       1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
140      {GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW, GL_INT, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::Shadow, 1,
141       1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
142      {GL_SAMPLER_EXTERNAL_OES, GL_INT, GL_TEXTURE_EXTERNAL_OES, GL_NONE, GL_NONE,
143       SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
144       false, false},
145      {GL_UNSIGNED_INT, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL, SamplerFormat::InvalidEnum, 1, 1,
146       1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1, false, false, false},
147      {GL_UNSIGNED_INT_ATOMIC_COUNTER, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_NONE,
148       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
149       false, false, false},
150      {GL_UNSIGNED_INT_IMAGE_2D, GL_UNSIGNED_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE,
151       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
152       false, false, true},
153      {GL_UNSIGNED_INT_IMAGE_2D_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
154       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
155       false, false, true},
156      {GL_UNSIGNED_INT_IMAGE_3D, GL_UNSIGNED_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE,
157       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
158       false, false, true},
159      {GL_UNSIGNED_INT_IMAGE_CUBE, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE,
160       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
161       false, false, true},
162      {GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE,
163       GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4,
164       sizeof(GLuint) * 1, false, false, true},
165      {GL_UNSIGNED_INT_IMAGE_BUFFER, GL_UNSIGNED_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE,
166       SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
167       false, false, true},
168      {GL_UNSIGNED_INT_SAMPLER_2D, GL_UNSIGNED_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE,
169       SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
170       true, false, false},
171      {GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
172       SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
173       true, false, false},
174      {GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE, GL_UNSIGNED_INT, GL_TEXTURE_2D_MULTISAMPLE, GL_NONE,
175       GL_NONE, SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4,
176       sizeof(GLuint) * 1, true, false, false},
177      {GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_UNSIGNED_INT,
178       GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_NONE, GL_NONE, SamplerFormat::Unsigned, 1, 1, 1,
179       sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1, true, false, false},
180      {GL_UNSIGNED_INT_SAMPLER_3D, GL_UNSIGNED_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE,
181       SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
182       true, false, false},
183      {GL_UNSIGNED_INT_SAMPLER_CUBE, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE,
184       SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
185       true, false, false},
186      {GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE,
187       GL_NONE, SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4,
188       sizeof(GLuint) * 1, true, false, false},
189      {GL_UNSIGNED_INT_SAMPLER_BUFFER, GL_UNSIGNED_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE,
190       SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
191       true, false, false},
192      {GL_UNSIGNED_INT_VEC2, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL_VEC2,
193       SamplerFormat::InvalidEnum, 1, 2, 2, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 2,
194       false, false, false},
195      {GL_UNSIGNED_INT_VEC3, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL_VEC3,
196       SamplerFormat::InvalidEnum, 1, 3, 3, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 3,
197       false, false, false},
198      {GL_UNSIGNED_INT_VEC4, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL_VEC4,
199       SamplerFormat::InvalidEnum, 1, 4, 4, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 4,
200       false, false, false},
201      {GL_SAMPLER_VIDEO_IMAGE_WEBGL, GL_INT, GL_TEXTURE_VIDEO_IMAGE_WEBGL, GL_NONE, GL_NONE,
202       SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
203       false, false},
204      {GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT, GL_INT, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1,
205       1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false}}};
206 
GetTypeInfoIndex(GLenum uniformType)207 size_t GetTypeInfoIndex(GLenum uniformType)
208 {
209     switch (uniformType)
210     {
211         case GL_NONE:
212             return 0;
213         case GL_BOOL:
214             return 1;
215         case GL_BOOL_VEC2:
216             return 2;
217         case GL_BOOL_VEC3:
218             return 3;
219         case GL_BOOL_VEC4:
220             return 4;
221         case GL_FLOAT:
222             return 5;
223         case GL_FLOAT_MAT2:
224             return 6;
225         case GL_FLOAT_MAT2x3:
226             return 7;
227         case GL_FLOAT_MAT2x4:
228             return 8;
229         case GL_FLOAT_MAT3:
230             return 9;
231         case GL_FLOAT_MAT3x2:
232             return 10;
233         case GL_FLOAT_MAT3x4:
234             return 11;
235         case GL_FLOAT_MAT4:
236             return 12;
237         case GL_FLOAT_MAT4x2:
238             return 13;
239         case GL_FLOAT_MAT4x3:
240             return 14;
241         case GL_FLOAT_VEC2:
242             return 15;
243         case GL_FLOAT_VEC3:
244             return 16;
245         case GL_FLOAT_VEC4:
246             return 17;
247         case GL_IMAGE_2D:
248             return 18;
249         case GL_IMAGE_2D_ARRAY:
250             return 19;
251         case GL_IMAGE_3D:
252             return 20;
253         case GL_IMAGE_CUBE:
254             return 21;
255         case GL_IMAGE_CUBE_MAP_ARRAY:
256             return 22;
257         case GL_IMAGE_BUFFER:
258             return 23;
259         case GL_INT:
260             return 24;
261         case GL_INT_IMAGE_2D:
262             return 25;
263         case GL_INT_IMAGE_2D_ARRAY:
264             return 26;
265         case GL_INT_IMAGE_3D:
266             return 27;
267         case GL_INT_IMAGE_CUBE:
268             return 28;
269         case GL_INT_IMAGE_CUBE_MAP_ARRAY:
270             return 29;
271         case GL_INT_IMAGE_BUFFER:
272             return 30;
273         case GL_INT_SAMPLER_2D:
274             return 31;
275         case GL_INT_SAMPLER_2D_ARRAY:
276             return 32;
277         case GL_INT_SAMPLER_2D_MULTISAMPLE:
278             return 33;
279         case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
280             return 34;
281         case GL_INT_SAMPLER_3D:
282             return 35;
283         case GL_INT_SAMPLER_CUBE:
284             return 36;
285         case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
286             return 37;
287         case GL_INT_SAMPLER_BUFFER:
288             return 38;
289         case GL_INT_VEC2:
290             return 39;
291         case GL_INT_VEC3:
292             return 40;
293         case GL_INT_VEC4:
294             return 41;
295         case GL_SAMPLER_2D:
296             return 42;
297         case GL_SAMPLER_2D_ARRAY:
298             return 43;
299         case GL_SAMPLER_2D_ARRAY_SHADOW:
300             return 44;
301         case GL_SAMPLER_2D_MULTISAMPLE:
302             return 45;
303         case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
304             return 46;
305         case GL_SAMPLER_2D_RECT_ANGLE:
306             return 47;
307         case GL_SAMPLER_2D_SHADOW:
308             return 48;
309         case GL_SAMPLER_3D:
310             return 49;
311         case GL_SAMPLER_CUBE:
312             return 50;
313         case GL_SAMPLER_CUBE_MAP_ARRAY:
314             return 51;
315         case GL_SAMPLER_BUFFER:
316             return 52;
317         case GL_SAMPLER_CUBE_SHADOW:
318             return 53;
319         case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
320             return 54;
321         case GL_SAMPLER_EXTERNAL_OES:
322             return 55;
323         case GL_UNSIGNED_INT:
324             return 56;
325         case GL_UNSIGNED_INT_ATOMIC_COUNTER:
326             return 57;
327         case GL_UNSIGNED_INT_IMAGE_2D:
328             return 58;
329         case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
330             return 59;
331         case GL_UNSIGNED_INT_IMAGE_3D:
332             return 60;
333         case GL_UNSIGNED_INT_IMAGE_CUBE:
334             return 61;
335         case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
336             return 62;
337         case GL_UNSIGNED_INT_IMAGE_BUFFER:
338             return 63;
339         case GL_UNSIGNED_INT_SAMPLER_2D:
340             return 64;
341         case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
342             return 65;
343         case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
344             return 66;
345         case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
346             return 67;
347         case GL_UNSIGNED_INT_SAMPLER_3D:
348             return 68;
349         case GL_UNSIGNED_INT_SAMPLER_CUBE:
350             return 69;
351         case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
352             return 70;
353         case GL_UNSIGNED_INT_SAMPLER_BUFFER:
354             return 71;
355         case GL_UNSIGNED_INT_VEC2:
356             return 72;
357         case GL_UNSIGNED_INT_VEC3:
358             return 73;
359         case GL_UNSIGNED_INT_VEC4:
360             return 74;
361         case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
362             return 75;
363         case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
364             return 76;
365         default:
366             UNREACHABLE();
367             return 0;
368     }
369 }
370 }  // anonymous namespace
371 
GetUniformTypeInfo(GLenum uniformType)372 const UniformTypeInfo &GetUniformTypeInfo(GLenum uniformType)
373 {
374     ASSERT(kInfoTable[GetTypeInfoIndex(uniformType)].type == uniformType);
375     return kInfoTable[GetTypeInfoIndex(uniformType)];
376 }
377 
378 }  // namespace gl
379