1 //
2 // Copyright 2019 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 // capture_gles31_params.cpp:
7 // Pointer parameter capture functions for the OpenGL ES 3.1 entry points.
8
9 #include "libANGLE/capture/capture_gles_3_1_autogen.h"
10
11 using namespace angle;
12
13 namespace gl
14 {
15
CaptureCreateShaderProgramv_strings(const State & glState,bool isCallValid,ShaderType typePacked,GLsizei count,const GLchar * const * strings,ParamCapture * paramCapture)16 void CaptureCreateShaderProgramv_strings(const State &glState,
17 bool isCallValid,
18 ShaderType typePacked,
19 GLsizei count,
20 const GLchar *const *strings,
21 ParamCapture *paramCapture)
22 {
23 CaptureShaderStrings(count, strings, nullptr, paramCapture);
24 }
25
CaptureDeleteProgramPipelines_pipelinesPacked(const State & glState,bool isCallValid,GLsizei n,const ProgramPipelineID * pipelines,ParamCapture * paramCapture)26 void CaptureDeleteProgramPipelines_pipelinesPacked(const State &glState,
27 bool isCallValid,
28 GLsizei n,
29 const ProgramPipelineID *pipelines,
30 ParamCapture *paramCapture)
31 {
32 CaptureArray(pipelines, n, paramCapture);
33 }
34
CaptureDrawArraysIndirect_indirect(const State & glState,bool isCallValid,PrimitiveMode modePacked,const void * indirect,ParamCapture * paramCapture)35 void CaptureDrawArraysIndirect_indirect(const State &glState,
36 bool isCallValid,
37 PrimitiveMode modePacked,
38 const void *indirect,
39 ParamCapture *paramCapture)
40 {
41 // DrawArraysIndirect requires that all data sourced for the command,
42 // including the DrawArraysIndirectCommand structure, be in buffer objects,
43 // and may not be called when the default vertex array object is bound.
44 // Indirect pointer is automatically captured in capture_gles_3_1_autogen.cpp
45 assert(!isCallValid || glState.getTargetBuffer(gl::BufferBinding::DrawIndirect));
46 }
47
CaptureDrawElementsIndirect_indirect(const State & glState,bool isCallValid,PrimitiveMode modePacked,DrawElementsType typePacked,const void * indirect,ParamCapture * paramCapture)48 void CaptureDrawElementsIndirect_indirect(const State &glState,
49 bool isCallValid,
50 PrimitiveMode modePacked,
51 DrawElementsType typePacked,
52 const void *indirect,
53 ParamCapture *paramCapture)
54 {
55 // DrawElementsIndirect requires that all data sourced for the command,
56 // including the DrawElementsIndirectCommand structure, be in buffer objects,
57 // and may not be called when the default vertex array object is bound
58 // Indirect pointer is automatically captured in capture_gles_3_1_autogen.cpp
59 assert(!isCallValid || glState.getTargetBuffer(gl::BufferBinding::DrawIndirect));
60 }
61
CaptureGenProgramPipelines_pipelinesPacked(const State & glState,bool isCallValid,GLsizei n,ProgramPipelineID * pipelines,ParamCapture * paramCapture)62 void CaptureGenProgramPipelines_pipelinesPacked(const State &glState,
63 bool isCallValid,
64 GLsizei n,
65 ProgramPipelineID *pipelines,
66 ParamCapture *paramCapture)
67 {
68 CaptureGenHandles(n, pipelines, paramCapture);
69 }
70
CaptureGetBooleani_v_data(const State & glState,bool isCallValid,GLenum target,GLuint index,GLboolean * data,ParamCapture * paramCapture)71 void CaptureGetBooleani_v_data(const State &glState,
72 bool isCallValid,
73 GLenum target,
74 GLuint index,
75 GLboolean *data,
76 ParamCapture *paramCapture)
77 {
78 CaptureMemory(data, sizeof(GLboolean), paramCapture);
79 }
80
CaptureGetFramebufferParameteriv_params(const State & glState,bool isCallValid,GLenum target,GLenum pname,GLint * params,ParamCapture * paramCapture)81 void CaptureGetFramebufferParameteriv_params(const State &glState,
82 bool isCallValid,
83 GLenum target,
84 GLenum pname,
85 GLint *params,
86 ParamCapture *paramCapture)
87 {
88 // All glGetFramebufferParameteriv queries write back one single value.
89 paramCapture->readBufferSizeBytes = sizeof(GLint);
90 }
91
CaptureGetMultisamplefv_val(const State & glState,bool isCallValid,GLenum pname,GLuint index,GLfloat * val,ParamCapture * paramCapture)92 void CaptureGetMultisamplefv_val(const State &glState,
93 bool isCallValid,
94 GLenum pname,
95 GLuint index,
96 GLfloat *val,
97 ParamCapture *paramCapture)
98 {
99 UNIMPLEMENTED();
100 }
101
CaptureGetProgramInterfaceiv_params(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLenum pname,GLint * params,ParamCapture * paramCapture)102 void CaptureGetProgramInterfaceiv_params(const State &glState,
103 bool isCallValid,
104 ShaderProgramID program,
105 GLenum programInterface,
106 GLenum pname,
107 GLint *params,
108 ParamCapture *paramCapture)
109 {
110 paramCapture->readBufferSizeBytes = sizeof(GLint);
111 }
112
CaptureGetProgramPipelineInfoLog_length(const State & glState,bool isCallValid,ProgramPipelineID pipeline,GLsizei bufSize,GLsizei * length,GLchar * infoLog,ParamCapture * paramCapture)113 void CaptureGetProgramPipelineInfoLog_length(const State &glState,
114 bool isCallValid,
115 ProgramPipelineID pipeline,
116 GLsizei bufSize,
117 GLsizei *length,
118 GLchar *infoLog,
119 ParamCapture *paramCapture)
120 {
121 if (length)
122 {
123 CaptureMemory(length, sizeof(GLsizei), paramCapture);
124 }
125 }
126
CaptureGetProgramPipelineInfoLog_infoLog(const State & glState,bool isCallValid,ProgramPipelineID pipeline,GLsizei bufSize,GLsizei * length,GLchar * infoLog,ParamCapture * paramCapture)127 void CaptureGetProgramPipelineInfoLog_infoLog(const State &glState,
128 bool isCallValid,
129 ProgramPipelineID pipeline,
130 GLsizei bufSize,
131 GLsizei *length,
132 GLchar *infoLog,
133 ParamCapture *paramCapture)
134 {
135 if (bufSize > 0)
136 {
137 ASSERT(infoLog);
138 if (length)
139 {
140 CaptureArray(infoLog, *length, paramCapture);
141 }
142 else
143 {
144 CaptureString(infoLog, paramCapture);
145 }
146 }
147 }
148
CaptureGetProgramPipelineiv_params(const State & glState,bool isCallValid,ProgramPipelineID pipeline,GLenum pname,GLint * params,ParamCapture * paramCapture)149 void CaptureGetProgramPipelineiv_params(const State &glState,
150 bool isCallValid,
151 ProgramPipelineID pipeline,
152 GLenum pname,
153 GLint *params,
154 ParamCapture *paramCapture)
155 {
156 CaptureMemory(params, sizeof(GLint), paramCapture);
157 }
158
CaptureGetProgramResourceIndex_name(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,const GLchar * name,ParamCapture * paramCapture)159 void CaptureGetProgramResourceIndex_name(const State &glState,
160 bool isCallValid,
161 ShaderProgramID program,
162 GLenum programInterface,
163 const GLchar *name,
164 ParamCapture *paramCapture)
165 {
166 CaptureString(name, paramCapture);
167 }
168
CaptureGetProgramResourceLocation_name(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,const GLchar * name,ParamCapture * paramCapture)169 void CaptureGetProgramResourceLocation_name(const State &glState,
170 bool isCallValid,
171 ShaderProgramID program,
172 GLenum programInterface,
173 const GLchar *name,
174 ParamCapture *paramCapture)
175 {
176 CaptureString(name, paramCapture);
177 }
178
CaptureGetProgramResourceName_length(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei bufSize,GLsizei * length,GLchar * name,ParamCapture * paramCapture)179 void CaptureGetProgramResourceName_length(const State &glState,
180 bool isCallValid,
181 ShaderProgramID program,
182 GLenum programInterface,
183 GLuint index,
184 GLsizei bufSize,
185 GLsizei *length,
186 GLchar *name,
187 ParamCapture *paramCapture)
188 {
189 paramCapture->readBufferSizeBytes = sizeof(GLsizei);
190 }
191
CaptureGetProgramResourceName_name(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei bufSize,GLsizei * length,GLchar * name,ParamCapture * paramCapture)192 void CaptureGetProgramResourceName_name(const State &glState,
193 bool isCallValid,
194 ShaderProgramID program,
195 GLenum programInterface,
196 GLuint index,
197 GLsizei bufSize,
198 GLsizei *length,
199 GLchar *name,
200 ParamCapture *paramCapture)
201 {
202 CaptureString(name, paramCapture);
203 }
204
CaptureGetProgramResourceiv_props(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei bufSize,GLsizei * length,GLint * params,ParamCapture * paramCapture)205 void CaptureGetProgramResourceiv_props(const State &glState,
206 bool isCallValid,
207 ShaderProgramID program,
208 GLenum programInterface,
209 GLuint index,
210 GLsizei propCount,
211 const GLenum *props,
212 GLsizei bufSize,
213 GLsizei *length,
214 GLint *params,
215 ParamCapture *paramCapture)
216 {
217 CaptureMemory(props, sizeof(GLenum) * propCount, paramCapture);
218 }
219
CaptureGetProgramResourceiv_length(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei bufSize,GLsizei * length,GLint * params,ParamCapture * paramCapture)220 void CaptureGetProgramResourceiv_length(const State &glState,
221 bool isCallValid,
222 ShaderProgramID program,
223 GLenum programInterface,
224 GLuint index,
225 GLsizei propCount,
226 const GLenum *props,
227 GLsizei bufSize,
228 GLsizei *length,
229 GLint *params,
230 ParamCapture *paramCapture)
231 {
232 paramCapture->readBufferSizeBytes = sizeof(GLsizei);
233 }
234
CaptureGetProgramResourceiv_params(const State & glState,bool isCallValid,ShaderProgramID program,GLenum programInterface,GLuint index,GLsizei propCount,const GLenum * props,GLsizei bufSize,GLsizei * length,GLint * params,ParamCapture * paramCapture)235 void CaptureGetProgramResourceiv_params(const State &glState,
236 bool isCallValid,
237 ShaderProgramID program,
238 GLenum programInterface,
239 GLuint index,
240 GLsizei propCount,
241 const GLenum *props,
242 GLsizei bufSize,
243 GLsizei *length,
244 GLint *params,
245 ParamCapture *paramCapture)
246 {
247 // Prefer to only capture as many parameters as are returned,
248 // but if this is not known, then capture the whole buffer
249 int paramLength = length != nullptr ? *length : bufSize;
250 CaptureMemory(params, sizeof(GLint) * paramLength, paramCapture);
251 }
252
CaptureGetTexLevelParameterfv_params(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum pname,GLfloat * params,ParamCapture * paramCapture)253 void CaptureGetTexLevelParameterfv_params(const State &glState,
254 bool isCallValid,
255 TextureTarget targetPacked,
256 GLint level,
257 GLenum pname,
258 GLfloat *params,
259 ParamCapture *paramCapture)
260 {
261 CaptureMemory(params, sizeof(GLfloat), paramCapture);
262 }
263
CaptureGetTexLevelParameteriv_params(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum pname,GLint * params,ParamCapture * paramCapture)264 void CaptureGetTexLevelParameteriv_params(const State &glState,
265 bool isCallValid,
266 TextureTarget targetPacked,
267 GLint level,
268 GLenum pname,
269 GLint *params,
270 ParamCapture *paramCapture)
271 {
272 CaptureMemory(params, sizeof(GLint), paramCapture);
273 }
274
CaptureProgramUniform1fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)275 void CaptureProgramUniform1fv_value(const State &glState,
276 bool isCallValid,
277 ShaderProgramID program,
278 UniformLocation location,
279 GLsizei count,
280 const GLfloat *value,
281 ParamCapture *paramCapture)
282 {
283 CaptureMemory(value, sizeof(GLfloat) * count, paramCapture);
284 }
285
CaptureProgramUniform1iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)286 void CaptureProgramUniform1iv_value(const State &glState,
287 bool isCallValid,
288 ShaderProgramID program,
289 UniformLocation location,
290 GLsizei count,
291 const GLint *value,
292 ParamCapture *paramCapture)
293 {
294 CaptureMemory(value, sizeof(GLint) * count, paramCapture);
295 }
296
CaptureProgramUniform1uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)297 void CaptureProgramUniform1uiv_value(const State &glState,
298 bool isCallValid,
299 ShaderProgramID program,
300 UniformLocation location,
301 GLsizei count,
302 const GLuint *value,
303 ParamCapture *paramCapture)
304 {
305 CaptureMemory(value, sizeof(GLuint) * count, paramCapture);
306 }
307
CaptureProgramUniform2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)308 void CaptureProgramUniform2fv_value(const State &glState,
309 bool isCallValid,
310 ShaderProgramID program,
311 UniformLocation location,
312 GLsizei count,
313 const GLfloat *value,
314 ParamCapture *paramCapture)
315 {
316 CaptureMemory(value, sizeof(GLfloat) * 2 * count, paramCapture);
317 }
318
CaptureProgramUniform2iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)319 void CaptureProgramUniform2iv_value(const State &glState,
320 bool isCallValid,
321 ShaderProgramID program,
322 UniformLocation location,
323 GLsizei count,
324 const GLint *value,
325 ParamCapture *paramCapture)
326 {
327 CaptureMemory(value, sizeof(GLint) * 2 * count, paramCapture);
328 }
329
CaptureProgramUniform2uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)330 void CaptureProgramUniform2uiv_value(const State &glState,
331 bool isCallValid,
332 ShaderProgramID program,
333 UniformLocation location,
334 GLsizei count,
335 const GLuint *value,
336 ParamCapture *paramCapture)
337 {
338 CaptureMemory(value, sizeof(GLuint) * 2 * count, paramCapture);
339 }
340
CaptureProgramUniform3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)341 void CaptureProgramUniform3fv_value(const State &glState,
342 bool isCallValid,
343 ShaderProgramID program,
344 UniformLocation location,
345 GLsizei count,
346 const GLfloat *value,
347 ParamCapture *paramCapture)
348 {
349 CaptureMemory(value, sizeof(GLfloat) * 3 * count, paramCapture);
350 }
351
CaptureProgramUniform3iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)352 void CaptureProgramUniform3iv_value(const State &glState,
353 bool isCallValid,
354 ShaderProgramID program,
355 UniformLocation location,
356 GLsizei count,
357 const GLint *value,
358 ParamCapture *paramCapture)
359 {
360 CaptureMemory(value, sizeof(GLint) * 3 * count, paramCapture);
361 }
362
CaptureProgramUniform3uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)363 void CaptureProgramUniform3uiv_value(const State &glState,
364 bool isCallValid,
365 ShaderProgramID program,
366 UniformLocation location,
367 GLsizei count,
368 const GLuint *value,
369 ParamCapture *paramCapture)
370 {
371 CaptureMemory(value, sizeof(GLuint) * 3 * count, paramCapture);
372 }
373
CaptureProgramUniform4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLfloat * value,ParamCapture * paramCapture)374 void CaptureProgramUniform4fv_value(const State &glState,
375 bool isCallValid,
376 ShaderProgramID program,
377 UniformLocation location,
378 GLsizei count,
379 const GLfloat *value,
380 ParamCapture *paramCapture)
381 {
382 CaptureMemory(value, sizeof(GLfloat) * 4 * count, paramCapture);
383 }
384
CaptureProgramUniform4iv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLint * value,ParamCapture * paramCapture)385 void CaptureProgramUniform4iv_value(const State &glState,
386 bool isCallValid,
387 ShaderProgramID program,
388 UniformLocation location,
389 GLsizei count,
390 const GLint *value,
391 ParamCapture *paramCapture)
392 {
393 CaptureMemory(value, sizeof(GLint) * 4 * count, paramCapture);
394 }
395
CaptureProgramUniform4uiv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,const GLuint * value,ParamCapture * paramCapture)396 void CaptureProgramUniform4uiv_value(const State &glState,
397 bool isCallValid,
398 ShaderProgramID program,
399 UniformLocation location,
400 GLsizei count,
401 const GLuint *value,
402 ParamCapture *paramCapture)
403 {
404 CaptureMemory(value, sizeof(GLuint) * 4 * count, paramCapture);
405 }
406
CaptureProgramUniformMatrix2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)407 void CaptureProgramUniformMatrix2fv_value(const State &glState,
408 bool isCallValid,
409 ShaderProgramID program,
410 UniformLocation location,
411 GLsizei count,
412 GLboolean transpose,
413 const GLfloat *value,
414 ParamCapture *paramCapture)
415 {
416 CaptureMemory(value, sizeof(GLfloat) * 2 * 2 * count, paramCapture);
417 }
418
CaptureProgramUniformMatrix2x3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)419 void CaptureProgramUniformMatrix2x3fv_value(const State &glState,
420 bool isCallValid,
421 ShaderProgramID program,
422 UniformLocation location,
423 GLsizei count,
424 GLboolean transpose,
425 const GLfloat *value,
426 ParamCapture *paramCapture)
427 {
428 CaptureMemory(value, sizeof(GLfloat) * 2 * 3 * count, paramCapture);
429 }
430
CaptureProgramUniformMatrix2x4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)431 void CaptureProgramUniformMatrix2x4fv_value(const State &glState,
432 bool isCallValid,
433 ShaderProgramID program,
434 UniformLocation location,
435 GLsizei count,
436 GLboolean transpose,
437 const GLfloat *value,
438 ParamCapture *paramCapture)
439 {
440 CaptureMemory(value, sizeof(GLfloat) * 2 * 4 * count, paramCapture);
441 }
442
CaptureProgramUniformMatrix3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)443 void CaptureProgramUniformMatrix3fv_value(const State &glState,
444 bool isCallValid,
445 ShaderProgramID program,
446 UniformLocation location,
447 GLsizei count,
448 GLboolean transpose,
449 const GLfloat *value,
450 ParamCapture *paramCapture)
451 {
452 CaptureMemory(value, sizeof(GLfloat) * 3 * 3 * count, paramCapture);
453 }
454
CaptureProgramUniformMatrix3x2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)455 void CaptureProgramUniformMatrix3x2fv_value(const State &glState,
456 bool isCallValid,
457 ShaderProgramID program,
458 UniformLocation location,
459 GLsizei count,
460 GLboolean transpose,
461 const GLfloat *value,
462 ParamCapture *paramCapture)
463 {
464 CaptureMemory(value, sizeof(GLfloat) * 3 * 2 * count, paramCapture);
465 }
466
CaptureProgramUniformMatrix3x4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)467 void CaptureProgramUniformMatrix3x4fv_value(const State &glState,
468 bool isCallValid,
469 ShaderProgramID program,
470 UniformLocation location,
471 GLsizei count,
472 GLboolean transpose,
473 const GLfloat *value,
474 ParamCapture *paramCapture)
475 {
476 CaptureMemory(value, sizeof(GLfloat) * 3 * 4 * count, paramCapture);
477 }
478
CaptureProgramUniformMatrix4fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)479 void CaptureProgramUniformMatrix4fv_value(const State &glState,
480 bool isCallValid,
481 ShaderProgramID program,
482 UniformLocation location,
483 GLsizei count,
484 GLboolean transpose,
485 const GLfloat *value,
486 ParamCapture *paramCapture)
487 {
488 CaptureMemory(value, sizeof(GLfloat) * 4 * 4 * count, paramCapture);
489 }
490
CaptureProgramUniformMatrix4x2fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)491 void CaptureProgramUniformMatrix4x2fv_value(const State &glState,
492 bool isCallValid,
493 ShaderProgramID program,
494 UniformLocation location,
495 GLsizei count,
496 GLboolean transpose,
497 const GLfloat *value,
498 ParamCapture *paramCapture)
499 {
500 CaptureMemory(value, sizeof(GLfloat) * 4 * 2 * count, paramCapture);
501 }
502
CaptureProgramUniformMatrix4x3fv_value(const State & glState,bool isCallValid,ShaderProgramID program,UniformLocation location,GLsizei count,GLboolean transpose,const GLfloat * value,ParamCapture * paramCapture)503 void CaptureProgramUniformMatrix4x3fv_value(const State &glState,
504 bool isCallValid,
505 ShaderProgramID program,
506 UniformLocation location,
507 GLsizei count,
508 GLboolean transpose,
509 const GLfloat *value,
510 ParamCapture *paramCapture)
511 {
512 CaptureMemory(value, sizeof(GLfloat) * 4 * 3 * count, paramCapture);
513 }
514
515 } // namespace gl
516