Diligent Engine API Reference: D:/GitHub/DiligentEngine/DiligentCore/Graphics/GraphicsEngineOpenGL/include/GLStubs.h Source File

Diligent Engine API Reference

GLStubs.h
1 /* Copyright 2015-2018 Egor Yusov
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
12 *
13 * In no event and under no legal theory, whether in tort (including negligence),
14 * contract, or otherwise, unless required by applicable law (such as deliberate
15 * and grossly negligent acts) or agreed to in writing, shall any Contributor be
16 * liable for any damages, including any direct, indirect, special, incidental,
17 * or consequential damages of any character arising as a result of this License or
18 * out of the use or inability to use the software (including but not limited to damages
19 * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
20 * all other commercial damages or losses), even if such Contributor has been advised
21 * of the possibility of such damages.
22 */
23
24 #pragma once
25
26 // Define unsupported formats for OpenGL ES
27 #ifndef GL_RGBA16
28 # define GL_RGBA16 0x805B
29 #endif
30
31 #ifndef GL_RGBA16_SNORM
32 # define GL_RGBA16_SNORM 0x8F9B
33 #endif
34
35 #ifndef GL_RG16
36 # define GL_RG16 0x822C
37 #endif
38
39 #ifndef GL_RG16_SNORM
40 # define GL_RG16_SNORM 0x8F99
41 #endif
42
43 #ifndef GL_R16
44 # define GL_R16 0x822A
45 #endif
46
47 #ifndef GL_R16_SNORM
48 # define GL_R16_SNORM 0x8F98
49 #endif
50
51 #ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
52 # define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
53 #endif
54
55 #ifndef GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
56 # define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
57 #endif
58
59 #ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
60 # define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
61 #endif
62
63 #ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
64 # define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
65 #endif
66
67 #ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
68 # define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
69 #endif
70
71 #ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
72 # define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
73 #endif
74
75 #ifndef GL_COMPRESSED_RED_RGTC1
76 # define GL_COMPRESSED_RED_RGTC1 0x8DBB
77 #endif
78
79 #ifndef GL_COMPRESSED_SIGNED_RED_RGTC1
80 # define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
81 #endif
82
83 #ifndef GL_COMPRESSED_RG_RGTC2
84 # define GL_COMPRESSED_RG_RGTC2 0x8DBD
85 #endif
86
87 #ifndef GL_COMPRESSED_SIGNED_RG_RGTC2
88 # define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
89 #endif
90
91 #ifndef GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT
92 # define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
93 #endif
94
95 #ifndef GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT
96 # define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
97 #endif
98
99 #ifndef GL_COMPRESSED_RGBA_BPTC_UNORM
100 # define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C
101 #endif
102
103 #ifndef GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM
104 # define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D
105 #endif
106
107 #ifndef GL_UNSIGNED_SHORT_5_6_5_REV
108 # define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
109 #endif
110
111 #ifndef GL_UNSIGNED_INT_10_10_10_2
112 # define GL_UNSIGNED_INT_10_10_10_2 0x8036
113 #endif
114
115 #ifndef GL_UNSIGNED_SHORT_5_6_5_REV
116 # define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
117 #endif
118
119 #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV
120 # define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
121 #endif
122
123 // Define unsupported shaders
124 #ifndef GL_GEOMETRY_SHADER
125 # define GL_GEOMETRY_SHADER 0x8DD9
126 #endif
127
128 #ifndef GL_TESS_CONTROL_SHADER
129 # define GL_TESS_CONTROL_SHADER 0x8E88
130 #endif
131
132 #ifndef GL_TESS_EVALUATION_SHADER
133 # define GL_TESS_EVALUATION_SHADER 0x8E87
134 #endif
135
136 // Define unsupported texture filtering modes
137 #ifndef GL_CLAMP_TO_BORDER
138 # define GL_CLAMP_TO_BORDER 0
139 #endif
140
141 #ifndef GL_MIRROR_CLAMP_TO_EDGE
142 # define GL_MIRROR_CLAMP_TO_EDGE 0
143 #endif
144
145 // Define unsupported bind points
146 #ifndef GL_DRAW_INDIRECT_BUFFER
147 # define GL_DRAW_INDIRECT_BUFFER 0x8F3F
148 #endif
149
150 #ifndef GL_DISPATCH_INDIRECT_BUFFER
151 # define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
152 #endif
153
154 #ifndef GL_TEXTURE_1D_ARRAY
155 # define GL_TEXTURE_1D_ARRAY 0x8C18
156 #endif
157
158 #ifndef GL_TEXTURE_BINDING_1D_ARRAY
159 # define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
160 #endif
161
162 #ifndef GL_TEXTURE_1D
163 # define GL_TEXTURE_1D 0x0DE0
164 #endif
165
166 #ifndef GL_TEXTURE_BINDING_1D
167 # define GL_TEXTURE_BINDING_1D 0x8068
168 #endif
169
170 #ifndef GL_TEXTURE_2D_MULTISAMPLE
171 # define GL_TEXTURE_2D_MULTISAMPLE 0x9100
172 #endif
173
174 #ifndef GL_TEXTURE_BINDING_2D_MULTISAMPLE
175 # define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
176 #endif
177
178 #ifndef GL_TEXTURE_2D_MULTISAMPLE_ARRAY
179 # define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
180 #endif
181
182 #ifndef GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY
183 # define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
184 #endif
185
186 #ifndef GL_TEXTURE_CUBE_MAP_ARRAY
187 # define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
188 #endif
189
190 #ifndef GL_TEXTURE_BINDING_CUBE_MAP_ARRAY
191 # define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
192 #endif
193
194 #ifndef GL_TEXTURE_BUFFER
195 # define GL_TEXTURE_BUFFER 0x8C2A
196 #endif
197
198 // Define unsupported pipeline bind flags
199 #ifndef GL_VERTEX_SHADER_BIT
200 # define GL_VERTEX_SHADER_BIT 0x00000001
201 #endif
202
203 #ifndef GL_FRAGMENT_SHADER_BIT
204 # define GL_FRAGMENT_SHADER_BIT 0x00000002
205 #endif
206
207 #ifndef GL_GEOMETRY_SHADER_BIT
208 # define GL_GEOMETRY_SHADER_BIT 0x00000004
209 #endif
210
211 #ifndef GL_TESS_CONTROL_SHADER_BIT
212 # define GL_TESS_CONTROL_SHADER_BIT 0x00000008
213 #endif
214
215 #ifndef GL_TESS_EVALUATION_SHADER_BIT
216 # define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
217 #endif
218
219 #ifndef GL_COMPUTE_SHADER_BIT
220 # define GL_COMPUTE_SHADER_BIT 0x00000020
221 #endif
222
223 // Define unsupported sampler attributes
224 #ifndef GL_TEXTURE_LOD_BIAS
225 # define GL_TEXTURE_LOD_BIAS 0
226 #endif
227
228 #ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
229 # define GL_TEXTURE_MAX_ANISOTROPY_EXT 0
230 #endif
231
232 #ifndef GL_TEXTURE_BORDER_COLOR
233 # define GL_TEXTURE_BORDER_COLOR 0
234 #endif
235
236 // Other unsupported attributes
237 #ifndef GL_PROGRAM_SEPARABLE
238 # define GL_PROGRAM_SEPARABLE 0x8258
239 #endif
240
241 // Define unsupported uniform data types
242 #ifndef GL_SAMPLER_1D
243 #define GL_SAMPLER_1D 0x8B5D
244 #endif
245
246 #ifndef GL_SAMPLER_1D_SHADOW
247 #define GL_SAMPLER_1D_SHADOW 0x8B61
248 #endif
249
250 #ifndef GL_SAMPLER_1D_ARRAY
251 #define GL_SAMPLER_1D_ARRAY 0x8DC0
252 #endif
253
254 #ifndef GL_SAMPLER_1D_ARRAY_SHADOW
255 #define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
256 #endif
257
258 #ifndef GL_INT_SAMPLER_1D
259 #define GL_INT_SAMPLER_1D 0x8DC9
260 #endif
261
262 #ifndef GL_INT_SAMPLER_1D_ARRAY
263 #define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
264 #endif
265
266 #ifndef GL_UNSIGNED_INT_SAMPLER_1D
267 #define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
268 #endif
269
270 #ifndef GL_UNSIGNED_INT_SAMPLER_1D_ARRAY
271 #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
272 #endif
273
274 #ifndef GL_SAMPLER_CUBE_MAP_ARRAY
275 #define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
276 #endif
277
278 #ifndef GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW
279 #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
280 #endif
281
282 #ifndef GL_INT_SAMPLER_CUBE_MAP_ARRAY
283 #define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
284 #endif
285
286 #ifndef GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY
287 #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
288 #endif
289
290 #ifndef GL_SAMPLER_BUFFER
291 #define GL_SAMPLER_BUFFER 0x8DC2
292 #endif
293
294 #ifndef GL_INT_SAMPLER_BUFFER
295 #define GL_INT_SAMPLER_BUFFER 0x8DD0
296 #endif
297
298 #ifndef GL_UNSIGNED_INT_SAMPLER_BUFFER
299 #define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
300 #endif
301
302 #ifndef GL_SAMPLER_2D_MULTISAMPLE
303 #define GL_SAMPLER_2D_MULTISAMPLE 0x9108
304 #endif
305
306 #ifndef GL_INT_SAMPLER_2D_MULTISAMPLE
307 #define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
308 #endif
309
310 #ifndef GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE
311 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
312 #endif
313
314 #ifndef GL_SAMPLER_2D_MULTISAMPLE_ARRAY
315 #define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
316 #endif
317
318 #ifndef GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
319 #define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
320 #endif
321
322 #ifndef GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
323 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
324 #endif
325
326
327 #ifndef GL_IMAGE_1D
328 #define GL_IMAGE_1D 0x904C
329 #endif
330
331 #ifndef GL_IMAGE_2D
332 #define GL_IMAGE_2D 0x904D
333 #endif
334
335 #ifndef GL_IMAGE_3D
336 #define GL_IMAGE_3D 0x904E
337 #endif
338
339 #ifndef GL_IMAGE_2D_RECT
340 #define GL_IMAGE_2D_RECT 0x904F
341 #endif
342
343 #ifndef GL_IMAGE_CUBE
344 #define GL_IMAGE_CUBE 0x9050
345 #endif
346
347 #ifndef GL_IMAGE_BUFFER
348 #define GL_IMAGE_BUFFER 0x9051
349 #endif
350
351 #ifndef GL_IMAGE_1D_ARRAY
352 #define GL_IMAGE_1D_ARRAY 0x9052
353 #endif
354
355 #ifndef GL_IMAGE_2D_ARRAY
356 #define GL_IMAGE_2D_ARRAY 0x9053
357 #endif
358
359 #ifndef GL_IMAGE_CUBE_MAP_ARRAY
360 #define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
361 #endif
362
363 #ifndef GL_IMAGE_2D_MULTISAMPLE
364 #define GL_IMAGE_2D_MULTISAMPLE 0x9055
365 #endif
366
367 #ifndef GL_IMAGE_2D_MULTISAMPLE_ARRAY
368 #define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
369 #endif
370
371 #ifndef GL_INT_IMAGE_1D
372 #define GL_INT_IMAGE_1D 0x9057
373 #endif
374
375 #ifndef GL_INT_IMAGE_2D
376 #define GL_INT_IMAGE_2D 0x9058
377 #endif
378
379 #ifndef GL_INT_IMAGE_3D
380 #define GL_INT_IMAGE_3D 0x9059
381 #endif
382
383 #ifndef GL_INT_IMAGE_2D_RECT
384 #define GL_INT_IMAGE_2D_RECT 0x905A
385 #endif
386
387 #ifndef GL_INT_IMAGE_CUBE
388 #define GL_INT_IMAGE_CUBE 0x905B
389 #endif
390
391 #ifndef GL_INT_IMAGE_BUFFER
392 #define GL_INT_IMAGE_BUFFER 0x905C
393 #endif
394
395 #ifndef GL_INT_IMAGE_1D_ARRAY
396 #define GL_INT_IMAGE_1D_ARRAY 0x905D
397 #endif
398
399 #ifndef GL_INT_IMAGE_2D_ARRAY
400 #define GL_INT_IMAGE_2D_ARRAY 0x905E
401 #endif
402
403 #ifndef GL_INT_IMAGE_CUBE_MAP_ARRAY
404 #define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
405 #endif
406
407 #ifndef GL_INT_IMAGE_2D_MULTISAMPLE
408 #define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
409 #endif
410
411 #ifndef GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY
412 #define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
413 #endif
414
415 #ifndef GL_UNSIGNED_INT_IMAGE_1D
416 #define GL_UNSIGNED_INT_IMAGE_1D 0x9062
417 #endif
418
419 #ifndef GL_UNSIGNED_INT_IMAGE_2D
420 #define GL_UNSIGNED_INT_IMAGE_2D 0x9063
421 #endif
422
423 #ifndef GL_UNSIGNED_INT_IMAGE_3D
424 #define GL_UNSIGNED_INT_IMAGE_3D 0x9064
425 #endif
426
427 #ifndef GL_UNSIGNED_INT_IMAGE_2D_RECT
428 #define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
429 #endif
430
431 #ifndef GL_UNSIGNED_INT_IMAGE_CUBE
432 #define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
433 #endif
434
435 #ifndef GL_UNSIGNED_INT_IMAGE_BUFFER
436 #define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
437 #endif
438
439 #ifndef GL_UNSIGNED_INT_IMAGE_1D_ARRAY
440 #define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
441 #endif
442
443 #ifndef GL_UNSIGNED_INT_IMAGE_2D_ARRAY
444 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
445 #endif
446
447 #ifndef GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY
448 #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
449 #endif
450
451 #ifndef GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE
452 #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
453 #endif
454
455 #ifndef GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY
456 #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
457 #endif
458
459
460 // Compute shader stubs
461 #ifndef GL_READ_ONLY
462 # define GL_READ_ONLY 0x88B8
463 #endif
464
465 #ifndef GL_WRITE_ONLY
466 # define GL_WRITE_ONLY 0x88B9
467 #endif
468
469 #ifndef GL_READ_WRITE
470 # define GL_READ_WRITE 0x88BA
471 #endif
472
473 #ifndef GL_COMPUTE_SHADER
474 # define GL_COMPUTE_SHADER 0x91B9
475 #endif
476
477 #ifndef GL_ES_VERSION_3_1
478 #define LOAD_GL_BIND_IMAGE_TEXTURE
479 typedef void (GL_APIENTRY* PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
480 extern PFNGLBINDIMAGETEXTUREPROC glBindImageTexture;
481
482 #define LOAD_GL_DISPATCH_COMPUTE
483 typedef void (GL_APIENTRY* PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
484 extern PFNGLDISPATCHCOMPUTEPROC glDispatchCompute;
485
486 #define LOAD_GL_MEMORY_BARRIER
487 typedef void (GL_APIENTRY* PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
488 extern PFNGLMEMORYBARRIERPROC glMemoryBarrier;
489 #endif // GL_ES_VERSION_3_1
490
491 #ifndef GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT
492 # define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
493 #endif
494 #ifndef GL_ELEMENT_ARRAY_BARRIER_BIT
495 # define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
496 #endif
497 #ifndef GL_UNIFORM_BARRIER_BIT
498 # define GL_UNIFORM_BARRIER_BIT 0x00000004
499 #endif
500 #ifndef GL_TEXTURE_FETCH_BARRIER_BIT
501 # define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
502 #endif
503 #ifndef GL_SHADER_IMAGE_ACCESS_BARRIER_BIT
504 # define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
505 #endif
506 #ifndef GL_COMMAND_BARRIER_BIT
507 # define GL_COMMAND_BARRIER_BIT 0x00000040
508 #endif
509 #ifndef GL_PIXEL_BUFFER_BARRIER_BIT
510 # define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
511 #endif
512 #ifndef GL_TEXTURE_UPDATE_BARRIER_BIT
513 # define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
514 #endif
515 #ifndef GL_BUFFER_UPDATE_BARRIER_BIT
516 # define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
517 #endif
518 #ifndef GL_FRAMEBUFFER_BARRIER_BIT
519 # define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
520 #endif
521 #ifndef GL_TRANSFORM_FEEDBACK_BARRIER_BIT
522 # define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
523 #endif
524 #ifndef GL_ATOMIC_COUNTER_BARRIER_BIT
525 # define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
526 #endif
527 #ifndef GL_SHADER_STORAGE_BARRIER_BIT
528 # define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
529 #endif
530 #ifndef GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT
531 # define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000
532 #endif
533 #ifndef GL_QUERY_BUFFER_BARRIER_BIT
534 # define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000
535 #endif
536 #ifndef GL_ALL_BARRIER_BITS
537 # define GL_ALL_BARRIER_BITS 0xFFFFFFFF
538 #endif
539
540
541 //--------------------------- Texture queries -----------------------------
542 #ifndef GL_TEXTURE_WIDTH
543 # define GL_TEXTURE_WIDTH 0x1000
544 #endif
545
546 #ifndef GL_TEXTURE_HEIGHT
547 # define GL_TEXTURE_HEIGHT 0x1001
548 #endif
549
550 #ifndef GL_TEXTURE_DEPTH
551 # define GL_TEXTURE_DEPTH 0x8071
552 #endif
553
554 #ifndef GL_TEXTURE_INTERNAL_FORMAT
555 # define GL_TEXTURE_INTERNAL_FORMAT 0x1003
556 #endif
557
558
559 //------------------------ Program interface query ------------------------
560 #ifndef GL_UNIFORM
561 # define GL_UNIFORM 0x92E1
562 #endif
563
564 #ifndef GL_UNIFORM_BLOCK
565 # define GL_UNIFORM_BLOCK 0x92E2
566 #endif
567
568 #ifndef GL_PROGRAM_INPUT
569 # define GL_PROGRAM_INPUT 0x92E3
570 #endif
571
572 #ifndef GL_PROGRAM_OUTPUT
573 # define GL_PROGRAM_OUTPUT 0x92E4
574 #endif
575
576 #ifndef GL_BUFFER_VARIABLE
577 # define GL_BUFFER_VARIABLE 0x92E5
578 #endif
579
580 #ifndef GL_SHADER_STORAGE_BLOCK
581 # define GL_SHADER_STORAGE_BLOCK 0x92E6
582 #endif
583
584 #ifndef GL_IS_PER_PATCH
585 # define GL_IS_PER_PATCH 0x92E7
586 #endif
587
588 #ifndef GL_VERTEX_SUBROUTINE
589 # define GL_VERTEX_SUBROUTINE 0x92E8
590 #endif
591
592 #ifndef GL_TESS_CONTROL_SUBROUTINE
593 # define GL_TESS_CONTROL_SUBROUTINE 0x92E9
594 #endif
595
596 #ifndef GL_TESS_EVALUATION_SUBROUTINE
597 # define GL_TESS_EVALUATION_SUBROUTINE 0x92EA
598 #endif
599
600 #ifndef GL_GEOMETRY_SUBROUTINE
601 # define GL_GEOMETRY_SUBROUTINE 0x92EB
602 #endif
603
604 #ifndef GL_FRAGMENT_SUBROUTINE
605 # define GL_FRAGMENT_SUBROUTINE 0x92EC
606 #endif
607
608 #ifndef GL_COMPUTE_SUBROUTINE
609 # define GL_COMPUTE_SUBROUTINE 0x92ED
610 #endif
611
612 #ifndef GL_VERTEX_SUBROUTINE_UNIFORM
613 # define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE
614 #endif
615
616 #ifndef GL_TESS_CONTROL_SUBROUTINE_UNIFORM
617 # define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF
618 #endif
619
620 #ifndef GL_TESS_EVALUATION_SUBROUTINE_UNIFORM
621 # define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0
622 #endif
623
624 #ifndef GL_GEOMETRY_SUBROUTINE_UNIFORM
625 # define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1
626 #endif
627
628 #ifndef GL_FRAGMENT_SUBROUTINE_UNIFORM
629 # define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2
630 #endif
631
632 #ifndef GL_COMPUTE_SUBROUTINE_UNIFORM
633 # define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3
634 #endif
635
636 #ifndef GL_TRANSFORM_FEEDBACK_VARYING
637 # define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4
638 #endif
639
640 #ifndef GL_ACTIVE_RESOURCES
641 # define GL_ACTIVE_RESOURCES 0x92F5
642 #endif
643
644 #ifndef GL_MAX_NAME_LENGTH
645 # define GL_MAX_NAME_LENGTH 0x92F6
646 #endif
647
648 #ifndef GL_MAX_NUM_ACTIVE_VARIABLES
649 # define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7
650 #endif
651
652 #ifndef GL_MAX_NUM_COMPATIBLE_SUBROUTINES
653 # define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8
654 #endif
655
656 #ifndef GL_NAME_LENGTH
657 # define GL_NAME_LENGTH 0x92F9
658 #endif
659
660 #ifndef GL_TYPE
661 # define GL_TYPE 0x92FA
662 #endif
663
664 #ifndef GL_ARRAY_SIZE
665 # define GL_ARRAY_SIZE 0x92FB
666 #endif
667
668 #ifndef GL_OFFSET
669 # define GL_OFFSET 0x92FC
670 #endif
671
672 #ifndef GL_BLOCK_INDEX
673 # define GL_BLOCK_INDEX 0x92FD
674 #endif
675
676 #ifndef GL_ARRAY_STRIDE
677 # define GL_ARRAY_STRIDE 0x92FE
678 #endif
679
680 #ifndef GL_MATRIX_STRIDE
681 # define GL_MATRIX_STRIDE 0x92FF
682 #endif
683
684 #ifndef GL_IS_ROW_MAJOR
685 # define GL_IS_ROW_MAJOR 0x9300
686 #endif
687
688 #ifndef GL_ATOMIC_COUNTER_BUFFER_INDEX
689 # define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
690 #endif
691
692 #ifndef GL_BUFFER_BINDING
693 # define GL_BUFFER_BINDING 0x9302
694 #endif
695
696 #ifndef GL_BUFFER_DATA_SIZE
697 # define GL_BUFFER_DATA_SIZE 0x9303
698 #endif
699
700 #ifndef GL_NUM_ACTIVE_VARIABLES
701 # define GL_NUM_ACTIVE_VARIABLES 0x9304
702 #endif
703
704 #ifndef GL_ACTIVE_VARIABLES
705 # define GL_ACTIVE_VARIABLES 0x9305
706 #endif
707
708 #ifndef GL_REFERENCED_BY_VERTEX_SHADER
709 # define GL_REFERENCED_BY_VERTEX_SHADER 0x9306
710 #endif
711
712 #ifndef GL_REFERENCED_BY_TESS_CONTROL_SHADER
713 # define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307
714 #endif
715
716 #ifndef GL_REFERENCED_BY_TESS_EVALUATION_SHADER
717 # define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308
718 #endif
719
720 #ifndef GL_REFERENCED_BY_GEOMETRY_SHADER
721 # define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309
722 #endif
723
724 #ifndef GL_REFERENCED_BY_FRAGMENT_SHADER
725 # define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A
726 #endif
727
728 #ifndef GL_REFERENCED_BY_COMPUTE_SHADER
729 # define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B
730 #endif
731
732 #ifndef GL_TOP_LEVEL_ARRAY_SIZE
733 # define GL_TOP_LEVEL_ARRAY_SIZE 0x930C
734 #endif
735
736 #ifndef GL_TOP_LEVEL_ARRAY_STRIDE
737 # define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D
738 #endif
739
740 #ifndef GL_LOCATION
741 # define GL_LOCATION 0x930E
742 #endif
743
744 #ifndef GL_LOCATION_INDEX
745 # define GL_LOCATION_INDEX 0x930F
746 #endif
747
748
749
750 // --------------------- Shader storage buffer -----------------------
751
752 #ifndef GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES
753 # define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
754 #endif
755
756 #ifndef GL_SHADER_STORAGE_BUFFER
757 # define GL_SHADER_STORAGE_BUFFER 0x90D2
758 #endif
759
760 #ifndef GL_SHADER_STORAGE_BUFFER_BINDING
761 # define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3
762 #endif
763
764 #ifndef GL_SHADER_STORAGE_BUFFER_START
765 # define GL_SHADER_STORAGE_BUFFER_START 0x90D4
766 #endif
767
768 #ifndef GL_SHADER_STORAGE_BUFFER_SIZE
769 # define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5
770 #endif
771
772 #ifndef GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS
773 # define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
774 #endif
775
776 #ifndef GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS
777 # define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7
778 #endif
779
780 #ifndef GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS
781 # define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8
782 #endif
783
784 #ifndef GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS
785 # define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9
786 #endif
787
788 #ifndef GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS
789 # define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
790 #endif
791
792 #ifndef GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS
793 # define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
794 #endif
795
796 #ifndef GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS
797 # define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
798 #endif
799
800 #ifndef GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS
801 # define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
802 #endif
803
804 #ifndef GL_MAX_SHADER_STORAGE_BLOCK_SIZE
805 # define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
806 #endif
807
808 #ifndef GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT
809 # define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
810 #endif
811
812
813 // Polygon mode
814 #ifndef GL_POINT
815 # define GL_POINT 0x1B00
816 #endif
817
818 #ifndef GL_LINE
819 # define GL_LINE 0x1B01
820 #endif
821
822 #ifndef GL_FILL
823 # define GL_FILL 0x1B02
824 #endif
825
826
827 #ifndef GL_DEPTH_CLAMP
828 # define GL_DEPTH_CLAMP 0
829 #endif
830
831 // Blend functions
832 #ifndef GL_SRC1_COLOR
833 # define GL_SRC1_COLOR 0x88F9
834 #endif
835
836 #ifndef GL_ONE_MINUS_SRC1_COLOR
837 # define GL_ONE_MINUS_SRC1_COLOR 0x88FA
838 #endif
839
840 #ifndef GL_SOURCE1_ALPHA
841 # define GL_SOURCE1_ALPHA 0x8589
842 #endif
843
844 #ifndef GL_SRC1_ALPHA
845 # define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
846 #endif
847
848 #ifndef GL_ONE_MINUS_SRC1_ALPHA
849 # define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
850 #endif
851
852 /* ---------------------- GL_ARB_internalformat_query2 --------------------- */
853
854 #ifndef GL_INTERNALFORMAT_SUPPORTED
855 # define GL_INTERNALFORMAT_SUPPORTED 0x826F
856 #endif
857
858 // --------------------- Framebuffer SRGB -----------------------
859 #ifndef GL_FRAMEBUFFER_SRGB
860 # define GL_FRAMEBUFFER_SRGB 0x8DB9
861 #endif
862
863 // -------------------- Incomplete FBO error codes ---------------
864 #ifndef GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS
865 # define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
866 #endif
867
868 #ifndef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER
869 # define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
870 #endif
871
872 #ifndef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER
873 # define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
874 #endif
875
876 /* ---------------------- ARB_tessellation_shader --------------------- */
877 #ifndef GL_PATCHES
878 # define GL_PATCHES 0xE
879 #endif
880
881 #ifndef GL_PATCH_VERTICES
882 # define GL_PATCH_VERTICES 0x8E72
883 #endif
884
885
886 // Define unsupported GL function stubs
887 template<typename T>
888 void UnsupportedGLFunctionStub( const T &Name )
889 {
890 LOG_ERROR_MESSAGE( Name, "() is not supported in this API!\n" );
891 }
892
893 #define glDrawElementsInstancedBaseVertexBaseInstance(...) UnsupportedGLFunctionStub("glDrawElementsInstancedBaseVertexBaseInstance")
894 #define glDrawElementsInstancedBaseVertex(...) UnsupportedGLFunctionStub("glDrawElementsInstancedBaseVertex")
895 #define glDrawElementsInstancedBaseInstance(...) UnsupportedGLFunctionStub("glDrawElementsInstancedBaseInstance")
896 #define glDrawArraysInstancedBaseInstance(...) UnsupportedGLFunctionStub("glDrawArraysInstancedBaseInstance")
897 #define glDrawElementsBaseVertex(...) UnsupportedGLFunctionStub("glDrawElementsBaseVertex")
898 #define glTextureView(...) UnsupportedGLFunctionStub("glTextureView")
899 #define glTexStorage1D(...) UnsupportedGLFunctionStub("glTexStorage1D")
900 #define glTexSubImage1D(...) UnsupportedGLFunctionStub("glTexSubImage1D")
901 #define glTexStorage3DMultisample(...) UnsupportedGLFunctionStub("glTexStorage3DMultisample")
902
903 #ifndef GL_ES_VERSION_3_1
904
905 #define LOAD_GEN_PROGRAM_PIPELINES
906 typedef void (GL_APIENTRY* PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines);
907 extern PFNGLGENPROGRAMPIPELINESPROC glGenProgramPipelines;
908
909 #define LOAD_GL_DELETE_PROGRAM_PIPELINES
910 typedef void (GL_APIENTRY* PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines);
911 extern PFNGLDELETEPROGRAMPIPELINESPROC glDeleteProgramPipelines;
912
913 #define LOAD_GL_BIND_PROGRAM_PIPELINE
914 typedef void (GL_APIENTRY* PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
915 extern PFNGLBINDPROGRAMPIPELINEPROC glBindProgramPipeline;
916
917 #define LOAD_DRAW_ELEMENTS_INDIRECT
918 typedef void (GL_APIENTRY* PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
919 extern PFNGLDRAWELEMENTSINDIRECTPROC glDrawElementsIndirect;
920
921 #define LOAD_DRAW_ARRAYS_INDIRECT
922 typedef void (GL_APIENTRY* PFNGLDRAWARRAYSINDIRECTPROC)( GLenum mode, const GLvoid *indirect );
923 extern PFNGLDRAWARRAYSINDIRECTPROC glDrawArraysIndirect;
924
925 #define LOAD_DISPATCH_COMPUTE_INDIRECT
926 typedef void (GL_APIENTRY* PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
927 extern PFNGLDISPATCHCOMPUTEINDIRECTPROC glDispatchComputeIndirect;
928
929 #define LOAD_GL_USE_PROGRAM_STAGES
930 typedef void (GL_APIENTRY* PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
931 extern PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages;
932
933 #define LOAD_GL_TEX_STORAGE_2D_MULTISAMPLE
934 typedef void (GL_APIENTRY* PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
935 extern PFNGLTEXSTORAGE2DMULTISAMPLEPROC glTexStorage2DMultisample;
936
937 #define LOAD_GL_PROGRAM_UNIFORM_1I
938 typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x);
939 extern PFNGLPROGRAMUNIFORM1IPROC glProgramUniform1i;
940
941 #define LOAD_GL_GET_PROGRAM_INTERFACEIV
942 typedef void (GL_APIENTRY* PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params);
943 extern PFNGLGETPROGRAMINTERFACEIVPROC glGetProgramInterfaceiv;
944
945 #define LOAD_GL_GET_PROGRAM_RESOURCE_NAME
946 typedef void (GL_APIENTRY* PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name);
947 extern PFNGLGETPROGRAMRESOURCENAMEPROC glGetProgramResourceName;
948
949 #define LOAD_GL_GET_PROGRAM_RESOURCEIV
950 typedef void (GL_APIENTRY* PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params);
951 extern PFNGLGETPROGRAMRESOURCEIVPROC glGetProgramResourceiv;
952
953 #define LOAD_GET_TEX_LEVEL_PARAMETER_IV
954 typedef void (GL_APIENTRY* PFNGLGETTEXLEVELPARAMETERIVPROC) (GLenum target, GLint level, GLenum pname, GLint *params);
955 extern PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv;
956
957 #endif //GL_ES_VERSION_3_1
958
959 #define LOAD_GL_TEX_BUFFER
960 typedef void (GL_APIENTRY* PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint);
961 extern PFNGLTEXBUFFERPROC glTexBuffer;
962
963 #define LOAD_GL_VIEWPORT_INDEXEDF
964 typedef void (GL_APIENTRY* PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
965 extern PFNGLVIEWPORTINDEXEDFPROC glViewportIndexedf;
966
967 #define LOAD_GL_SCISSOR_INDEXED
968 typedef void (GL_APIENTRY* PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
969 extern PFNGLSCISSORINDEXEDPROC glScissorIndexed;
970
971 #define LOAD_GL_POLYGON_MODE
972 typedef void (GL_APIENTRY* PFNGLPOLYGONMODE) (GLenum face, GLenum mode);
973 extern PFNGLPOLYGONMODE glPolygonMode;
974
975 #define LOAD_GL_ENABLEI
976 typedef void (GL_APIENTRY* PFNGLENABLEIPROC) (GLenum, GLuint);
977 extern PFNGLENABLEIPROC glEnablei;
978
979 #define LOAD_GL_BLEND_FUNC_SEPARATEI
980 typedef void (GL_APIENTRY* PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
981 extern PFNGLBLENDFUNCSEPARATEIPROC glBlendFuncSeparatei;
982
983 #define LOAD_GL_BLEND_EQUATION_SEPARATEI
984 typedef void (GL_APIENTRY* PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
985 extern PFNGLBLENDEQUATIONSEPARATEIPROC glBlendEquationSeparatei;
986
987 #define LOAD_GL_DISABLEI
988 typedef void (GL_APIENTRY* PFNGLDISABLEIPROC) (GLenum, GLuint);
989 extern PFNGLDISABLEIPROC glDisablei;
990
991 #define LOAD_GL_COLOR_MASKI
992 typedef void (GL_APIENTRY* PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
993 extern PFNGLCOLORMASKIPROC glColorMaski;
994
995 #define LOAD_GL_PATCH_PARAMTER_I
996 typedef void (GL_APIENTRY* PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
997 extern PFNGLPATCHPARAMETERIPROC glPatchParameteri;
998
999 #define LOAD_GL_FRAMEBUFFER_TEXTURE
1000 typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint);
1001 extern PFNGLFRAMEBUFFERTEXTUREPROC glFramebufferTexture;
1002
1003 #define LOAD_GL_FRAMEBUFFER_TEXTURE_1D
1004 typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1005 extern PFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D;
1006
1007 #define LOAD_GL_FRAMEBUFFER_TEXTURE_3D
1008 typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
1009 extern PFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D;
1010
1011 #define LOAD_GL_COPY_IMAGE_SUB_DATA
1012 typedef void (GL_APIENTRY* PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
1013 extern PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData;
1014
1015 void LoadGLFunctions();