1/****************************************************************************
2**
3** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
4** Copyright (C) 2016 The Qt Company Ltd.
5** Contact: https://www.qt.io/licensing/
6**
7** This file is part of the QtGui module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial License Usage
11** Licensees holding valid commercial Qt licenses may use this file in
12** accordance with the commercial license agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and The Qt Company. For licensing terms
15** and conditions see https://www.qt.io/terms-conditions. For further
16** information use the contact form at https://www.qt.io/contact-us.
17**
18** GNU Lesser General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU Lesser
20** General Public License version 3 as published by the Free Software
21** Foundation and appearing in the file LICENSE.LGPL3 included in the
22** packaging of this file. Please review the following information to
23** ensure the GNU Lesser General Public License version 3 requirements
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
25**
26** GNU General Public License Usage
27** Alternatively, this file may be used under the terms of the GNU
28** General Public License version 2.0 or (at your option) the GNU General
29** Public license version 3 or any later version approved by the KDE Free
30** Qt Foundation. The licenses are as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
32** included in the packaging of this file. Please review the following
33** information to ensure the GNU General Public License requirements will
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and
35** https://www.gnu.org/licenses/gpl-3.0.html.
36**
37** $QT_END_LICENSE$
38**
39**
40** This file was generated by glgen version 0.1
41** Command line was: glgen
42**
43** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
44**
45** This is an auto-generated file.
46** Do not edit! All changes made to it will be lost.
47**
48****************************************************************************/
49
50#ifndef QOPENGLVERSIONFUNCTIONS_H
51#define QOPENGLVERSIONFUNCTIONS_H
52
53#include <QtGui/qtguiglobal.h>
54
55#ifndef QT_NO_OPENGL
56
57#if QT_DEPRECATED_SINCE(5, 6)
58#include <QtCore/qhash.h>
59#endif
60#include <QtCore/qhashfunctions.h>
61#include <QtCore/qpair.h>
62#include <QtGui/qopengl.h>
63
64QT_BEGIN_NAMESPACE
65
66class QOpenGLContext;
67
68#if 0
69// silence syncqt warnings
70#pragma qt_class(QOpenGLVersionFunctions)
71#pragma qt_sync_stop_processing
72#endif
73
74#define QOPENGL_DEPRECATEDFUNCTION \
75 qFatal("This function was erroneously included in previous versions of Qt and is here only for binary compatibility. " \
76 "If you need to use this function, please use a legacy OpenGL version or a Compatibility profile.")
77
78struct QOpenGLVersionStatus
79{
80 enum OpenGLStatus {
81 CoreStatus,
82 DeprecatedStatus,
83 InvalidStatus
84 };
85
86 Q_DECL_CONSTEXPR QOpenGLVersionStatus()
87 : version(0, 0),
88 status(InvalidStatus)
89 {}
90
91 Q_DECL_CONSTEXPR QOpenGLVersionStatus(int majorVersion, int minorVersion, QOpenGLVersionStatus::OpenGLStatus functionStatus)
92 : version(majorVersion, minorVersion),
93 status(functionStatus)
94 {}
95
96 QPair<int, int> version;
97 OpenGLStatus status;
98};
99
100inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0) noexcept
101{
102 return qHash(static_cast<int>(v.status * 1000)
103 + v.version.first * 100 + v.version.second * 10, seed);
104}
105
106Q_DECL_CONSTEXPR inline bool operator==(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs)
107{
108 return lhs.status == rhs.status && lhs.version == rhs.version;
109}
110
111Q_DECL_CONSTEXPR inline bool operator!=(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs)
112{
113 return !operator==(lhs, rhs);
114}
115
116#define QT_OPENGL_DECLARE_FUNCTIONS(ret, name, args) \
117 ret (QOPENGLF_APIENTRYP name)args;
118#define QT_OPENGL_COUNT_FUNCTIONS(ret, name, args) +1
119
120#define QT_OPENGL_DECLARE(FUNCTIONS) \
121public: \
122 struct Functions { \
123 FUNCTIONS(QT_OPENGL_DECLARE_FUNCTIONS) \
124 }; \
125 union { \
126 QFunctionPointer functions[FUNCTIONS(QT_OPENGL_COUNT_FUNCTIONS)]; \
127 Functions f; \
128 }; \
129private: \
130 void init()
131
132class QOpenGLVersionFunctionsBackend
133{
134public:
135#define QT_OPENGL_VERSIONS(F) \
136 F(1_0_Core) \
137 F(1_1_Core) \
138 F(1_2_Core) \
139 F(1_3_Core) \
140 F(1_4_Core) \
141 F(1_5_Core) \
142 F(2_0_Core) \
143 F(2_1_Core) \
144 F(3_0_Core) \
145 F(3_1_Core) \
146 F(3_2_Core) \
147 F(3_3_Core) \
148 F(4_0_Core) \
149 F(4_1_Core) \
150 F(4_2_Core) \
151 F(4_3_Core) \
152 F(4_4_Core) \
153 F(4_5_Core) \
154 F(1_0_Deprecated) \
155 F(1_1_Deprecated) \
156 F(1_2_Deprecated) \
157 F(1_3_Deprecated) \
158 F(1_4_Deprecated) \
159 F(2_0_Deprecated) \
160 F(3_0_Deprecated) \
161 F(3_3_Deprecated) \
162 F(4_5_Deprecated) \
163
164#define VERSION_ENUM(X) OpenGL_##X,
165 enum Version {
166 QT_OPENGL_VERSIONS(VERSION_ENUM)
167 OpenGLVersionBackendCount
168 };
169#undef VERSION_ENUM
170
171 QOpenGLVersionFunctionsBackend(QOpenGLContext *ctx)
172 : context(ctx)
173 {}
174
175 QOpenGLContext *context;
176 QAtomicInt refs;
177};
178
179class QOpenGLVersionFunctionsStorage
180{
181public:
182 QOpenGLVersionFunctionsStorage();
183 ~QOpenGLVersionFunctionsStorage();
184
185 QOpenGLVersionFunctionsBackend *backend(QOpenGLContext *context, QOpenGLVersionFunctionsBackend::Version v);
186
187 QOpenGLVersionFunctionsBackend **backends;
188};
189
190class QAbstractOpenGLFunctions;
191
192class QAbstractOpenGLFunctionsPrivate
193{
194public:
195 QAbstractOpenGLFunctionsPrivate()
196 : owningContext(nullptr),
197 initialized(false)
198 {}
199
200 static QOpenGLVersionFunctionsBackend *functionsBackend(QOpenGLContext *context, QOpenGLVersionFunctionsBackend::Version v);
201 static void insertExternalFunctions(QOpenGLContext *context, QAbstractOpenGLFunctions *f);
202 static void removeExternalFunctions(QOpenGLContext *context, QAbstractOpenGLFunctions *f);
203
204 static QAbstractOpenGLFunctionsPrivate *get(QAbstractOpenGLFunctions *q);
205
206 QOpenGLContext *owningContext;
207 bool initialized;
208};
209
210class Q_GUI_EXPORT QAbstractOpenGLFunctions
211{
212public:
213 virtual ~QAbstractOpenGLFunctions();
214
215 virtual bool initializeOpenGLFunctions();
216
217 Q_DISABLE_COPY(QAbstractOpenGLFunctions)
218 Q_DECLARE_PRIVATE(QAbstractOpenGLFunctions)
219
220protected:
221 QAbstractOpenGLFunctions();
222 QAbstractOpenGLFunctionsPrivate *d_ptr;
223
224 bool isInitialized() const;
225
226 void setOwningContext(const QOpenGLContext *context);
227 QOpenGLContext *owningContext() const;
228
229 friend class QOpenGLContext;
230};
231
232inline QAbstractOpenGLFunctionsPrivate *QAbstractOpenGLFunctionsPrivate::get(QAbstractOpenGLFunctions *q)
233{
234 return q->d_func();
235}
236
237#if !defined(QT_OPENGL_ES_2)
238
239class QOpenGLFunctions_1_0_CoreBackend : public QOpenGLVersionFunctionsBackend
240{
241public:
242 QOpenGLFunctions_1_0_CoreBackend(QOpenGLContext *c)
243 : QOpenGLVersionFunctionsBackend(c)
244 {
245 init();
246 }
247
248 Q_DECL_CONSTEXPR static Version versionStatus()
249 { return OpenGL_1_0_Core; }
250
251 // OpenGL 1.0 core functions
252#define QT_OPENGL_1_0_FUNCTIONS(F) \
253 F(void, Viewport, (GLint x, GLint y, GLsizei width, GLsizei height)) \
254 F(void, DepthRange, (GLdouble nearVal, GLdouble farVal)) \
255 F(GLboolean, IsEnabled, (GLenum cap)) \
256 F(void, GetTexLevelParameteriv, (GLenum target, GLint level, GLenum pname, GLint *params)) \
257 F(void, GetTexLevelParameterfv, (GLenum target, GLint level, GLenum pname, GLfloat *params)) \
258 F(void, GetTexParameteriv, (GLenum target, GLenum pname, GLint *params)) \
259 F(void, GetTexParameterfv, (GLenum target, GLenum pname, GLfloat *params)) \
260 F(void, GetTexImage, (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)) \
261 F(const GLubyte *, GetString, (GLenum name)) \
262 F(void, GetIntegerv, (GLenum pname, GLint *data)) \
263 F(void, GetFloatv, (GLenum pname, GLfloat *data)) \
264 F(GLenum, GetError, ()) \
265 F(void, GetDoublev, (GLenum pname, GLdouble *data)) \
266 F(void, GetBooleanv, (GLenum pname, GLboolean *data)) \
267 F(void, ReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)) \
268 F(void, ReadBuffer, (GLenum src)) \
269 F(void, PixelStorei, (GLenum pname, GLint param)) \
270 F(void, PixelStoref, (GLenum pname, GLfloat param)) \
271 F(void, DepthFunc, (GLenum func)) \
272 F(void, StencilOp, (GLenum fail, GLenum zfail, GLenum zpass)) \
273 F(void, StencilFunc, (GLenum func, GLint ref, GLuint mask)) \
274 F(void, LogicOp, (GLenum opcode)) \
275 F(void, BlendFunc, (GLenum sfactor, GLenum dfactor)) \
276 F(void, Flush, ()) \
277 F(void, Finish, ()) \
278 F(void, Enable, (GLenum cap)) \
279 F(void, Disable, (GLenum cap)) \
280 F(void, DepthMask, (GLboolean flag)) \
281 F(void, ColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) \
282 F(void, StencilMask, (GLuint mask)) \
283 F(void, ClearDepth, (GLdouble depth)) \
284 F(void, ClearStencil, (GLint s)) \
285 F(void, ClearColor, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)) \
286 F(void, Clear, (GLbitfield mask)) \
287 F(void, DrawBuffer, (GLenum buf)) \
288 F(void, TexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) \
289 F(void, TexImage1D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) \
290 F(void, TexParameteriv, (GLenum target, GLenum pname, const GLint *params)) \
291 F(void, TexParameteri, (GLenum target, GLenum pname, GLint param)) \
292 F(void, TexParameterfv, (GLenum target, GLenum pname, const GLfloat *params)) \
293 F(void, TexParameterf, (GLenum target, GLenum pname, GLfloat param)) \
294 F(void, Scissor, (GLint x, GLint y, GLsizei width, GLsizei height)) \
295 F(void, PolygonMode, (GLenum face, GLenum mode)) \
296 F(void, PointSize, (GLfloat size)) \
297 F(void, LineWidth, (GLfloat width)) \
298 F(void, Hint, (GLenum target, GLenum mode)) \
299 F(void, FrontFace, (GLenum mode)) \
300 F(void, CullFace, (GLenum mode)) \
301
302 QT_OPENGL_DECLARE(QT_OPENGL_1_0_FUNCTIONS);
303};
304
305class QOpenGLFunctions_1_1_CoreBackend : public QOpenGLVersionFunctionsBackend
306{
307public:
308 QOpenGLFunctions_1_1_CoreBackend(QOpenGLContext *c)
309 : QOpenGLVersionFunctionsBackend(c)
310 {
311 init();
312 }
313
314 Q_DECL_CONSTEXPR static Version versionStatus()
315 { return OpenGL_1_1_Core; }
316
317 // OpenGL 1.1 core functions
318#define QT_OPENGL_1_1_FUNCTIONS(F) \
319 F(void, Indexubv, (const GLubyte *c)) \
320 F(void, Indexub, (GLubyte c)) \
321 F(GLboolean, IsTexture, (GLuint texture)) \
322 F(void, GenTextures, (GLsizei n, GLuint *textures)) \
323 F(void, DeleteTextures, (GLsizei n, const GLuint *textures)) \
324 F(void, BindTexture, (GLenum target, GLuint texture)) \
325 F(void, TexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) \
326 F(void, TexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)) \
327 F(void, CopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) \
328 F(void, CopyTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) \
329 F(void, CopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) \
330 F(void, CopyTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)) \
331 F(void, PolygonOffset, (GLfloat factor, GLfloat units)) \
332 F(void, GetPointerv, (GLenum pname, GLvoid* *params)) \
333 F(void, DrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)) \
334 F(void, DrawArrays, (GLenum mode, GLint first, GLsizei count)) \
335
336 QT_OPENGL_DECLARE(QT_OPENGL_1_1_FUNCTIONS);
337};
338
339class QOpenGLFunctions_1_2_CoreBackend : public QOpenGLVersionFunctionsBackend
340{
341public:
342 QOpenGLFunctions_1_2_CoreBackend(QOpenGLContext *c)
343 : QOpenGLVersionFunctionsBackend(c)
344 {
345 init();
346 }
347
348 Q_DECL_CONSTEXPR static Version versionStatus()
349 { return OpenGL_1_2_Core; }
350
351 // OpenGL 1.2 core functions
352#define QT_OPENGL_1_2_FUNCTIONS(F) \
353 F(void, CopyTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)) \
354 F(void, TexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)) \
355 F(void, TexImage3D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) \
356 F(void, DrawRangeElements, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)) \
357 F(void, BlendEquation, (GLenum mode)) \
358 F(void, BlendColor, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)) \
359
360 QT_OPENGL_DECLARE(QT_OPENGL_1_2_FUNCTIONS);
361};
362
363class QOpenGLFunctions_1_3_CoreBackend : public QOpenGLVersionFunctionsBackend
364{
365public:
366 QOpenGLFunctions_1_3_CoreBackend(QOpenGLContext *c)
367 : QOpenGLVersionFunctionsBackend(c)
368 {
369 init();
370 }
371
372 Q_DECL_CONSTEXPR static Version versionStatus()
373 { return OpenGL_1_3_Core; }
374
375 // OpenGL 1.3 core functions
376#define QT_OPENGL_1_3_FUNCTIONS(F) \
377 F(void, GetCompressedTexImage, (GLenum target, GLint level, GLvoid *img)) \
378 F(void, CompressedTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)) \
379 F(void, CompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)) \
380 F(void, CompressedTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)) \
381 F(void, CompressedTexImage1D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)) \
382 F(void, CompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)) \
383 F(void, CompressedTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)) \
384 F(void, SampleCoverage, (GLfloat value, GLboolean invert)) \
385 F(void, ActiveTexture, (GLenum texture)) \
386
387 QT_OPENGL_DECLARE(QT_OPENGL_1_3_FUNCTIONS);
388};
389
390class QOpenGLFunctions_1_4_CoreBackend : public QOpenGLVersionFunctionsBackend
391{
392public:
393 QOpenGLFunctions_1_4_CoreBackend(QOpenGLContext *c)
394 : QOpenGLVersionFunctionsBackend(c)
395 {
396 init();
397 }
398
399 Q_DECL_CONSTEXPR static Version versionStatus()
400 { return OpenGL_1_4_Core; }
401
402 // OpenGL 1.4 core functions
403#define QT_OPENGL_1_4_FUNCTIONS(F) \
404 F(void, PointParameteriv, (GLenum pname, const GLint *params)) \
405 F(void, PointParameteri, (GLenum pname, GLint param)) \
406 F(void, PointParameterfv, (GLenum pname, const GLfloat *params)) \
407 F(void, PointParameterf, (GLenum pname, GLfloat param)) \
408 F(void, MultiDrawElements, (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount)) \
409 F(void, MultiDrawArrays, (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount)) \
410 F(void, BlendFuncSeparate, (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)) \
411
412 QT_OPENGL_DECLARE(QT_OPENGL_1_4_FUNCTIONS);
413};
414
415class QOpenGLFunctions_1_5_CoreBackend : public QOpenGLVersionFunctionsBackend
416{
417public:
418 QOpenGLFunctions_1_5_CoreBackend(QOpenGLContext *c)
419 : QOpenGLVersionFunctionsBackend(c)
420 {
421 init();
422 }
423
424 Q_DECL_CONSTEXPR static Version versionStatus()
425 { return OpenGL_1_5_Core; }
426
427 // OpenGL 1.5 core functions
428#define QT_OPENGL_1_5_FUNCTIONS(F) \
429 F(void, GetBufferPointerv, (GLenum target, GLenum pname, GLvoid* *params)) \
430 F(void, GetBufferParameteriv, (GLenum target, GLenum pname, GLint *params)) \
431 F(GLboolean, UnmapBuffer, (GLenum target)) \
432 F(GLvoid*, MapBuffer, (GLenum target, GLenum access)) \
433 F(void, GetBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)) \
434 F(void, BufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)) \
435 F(void, BufferData, (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)) \
436 F(GLboolean, IsBuffer, (GLuint buffer)) \
437 F(void, GenBuffers, (GLsizei n, GLuint *buffers)) \
438 F(void, DeleteBuffers, (GLsizei n, const GLuint *buffers)) \
439 F(void, BindBuffer, (GLenum target, GLuint buffer)) \
440 F(void, GetQueryObjectuiv, (GLuint id, GLenum pname, GLuint *params)) \
441 F(void, GetQueryObjectiv, (GLuint id, GLenum pname, GLint *params)) \
442 F(void, GetQueryiv, (GLenum target, GLenum pname, GLint *params)) \
443 F(void, EndQuery, (GLenum target)) \
444 F(void, BeginQuery, (GLenum target, GLuint id)) \
445 F(GLboolean, IsQuery, (GLuint id)) \
446 F(void, DeleteQueries, (GLsizei n, const GLuint *ids)) \
447 F(void, GenQueries, (GLsizei n, GLuint *ids)) \
448
449 QT_OPENGL_DECLARE(QT_OPENGL_1_5_FUNCTIONS);
450};
451
452class QOpenGLFunctions_2_0_CoreBackend : public QOpenGLVersionFunctionsBackend
453{
454public:
455 QOpenGLFunctions_2_0_CoreBackend(QOpenGLContext *c)
456 : QOpenGLVersionFunctionsBackend(c)
457 {
458 init();
459 }
460
461 Q_DECL_CONSTEXPR static Version versionStatus()
462 { return OpenGL_2_0_Core; }
463
464 // OpenGL 2.0 core functions
465#define QT_OPENGL_2_0_FUNCTIONS(F) \
466 F(void, VertexAttribPointer, (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)) \
467 F(void, ValidateProgram, (GLuint program)) \
468 F(void, UniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
469 F(void, UniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
470 F(void, UniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
471 F(void, Uniform4iv, (GLint location, GLsizei count, const GLint *value)) \
472 F(void, Uniform3iv, (GLint location, GLsizei count, const GLint *value)) \
473 F(void, Uniform2iv, (GLint location, GLsizei count, const GLint *value)) \
474 F(void, Uniform1iv, (GLint location, GLsizei count, const GLint *value)) \
475 F(void, Uniform4fv, (GLint location, GLsizei count, const GLfloat *value)) \
476 F(void, Uniform3fv, (GLint location, GLsizei count, const GLfloat *value)) \
477 F(void, Uniform2fv, (GLint location, GLsizei count, const GLfloat *value)) \
478 F(void, Uniform1fv, (GLint location, GLsizei count, const GLfloat *value)) \
479 F(void, Uniform4i, (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) \
480 F(void, Uniform3i, (GLint location, GLint v0, GLint v1, GLint v2)) \
481 F(void, Uniform2i, (GLint location, GLint v0, GLint v1)) \
482 F(void, Uniform1i, (GLint location, GLint v0)) \
483 F(void, Uniform4f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) \
484 F(void, Uniform3f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) \
485 F(void, Uniform2f, (GLint location, GLfloat v0, GLfloat v1)) \
486 F(void, Uniform1f, (GLint location, GLfloat v0)) \
487 F(void, UseProgram, (GLuint program)) \
488 F(void, ShaderSource, (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length)) \
489 F(void, LinkProgram, (GLuint program)) \
490 F(GLboolean, IsShader, (GLuint shader)) \
491 F(GLboolean, IsProgram, (GLuint program)) \
492 F(void, GetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid* *pointer)) \
493 F(void, GetVertexAttribiv, (GLuint index, GLenum pname, GLint *params)) \
494 F(void, GetVertexAttribfv, (GLuint index, GLenum pname, GLfloat *params)) \
495 F(void, GetVertexAttribdv, (GLuint index, GLenum pname, GLdouble *params)) \
496 F(void, GetUniformiv, (GLuint program, GLint location, GLint *params)) \
497 F(void, GetUniformfv, (GLuint program, GLint location, GLfloat *params)) \
498 F(GLint, GetUniformLocation, (GLuint program, const GLchar *name)) \
499 F(void, GetShaderSource, (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)) \
500 F(void, GetShaderInfoLog, (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) \
501 F(void, GetShaderiv, (GLuint shader, GLenum pname, GLint *params)) \
502 F(void, GetProgramInfoLog, (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) \
503 F(void, GetProgramiv, (GLuint program, GLenum pname, GLint *params)) \
504 F(GLint, GetAttribLocation, (GLuint program, const GLchar *name)) \
505 F(void, GetAttachedShaders, (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders)) \
506 F(void, GetActiveUniform, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)) \
507 F(void, GetActiveAttrib, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)) \
508 F(void, EnableVertexAttribArray, (GLuint index)) \
509 F(void, DisableVertexAttribArray, (GLuint index)) \
510 F(void, DetachShader, (GLuint program, GLuint shader)) \
511 F(void, DeleteShader, (GLuint shader)) \
512 F(void, DeleteProgram, (GLuint program)) \
513 F(GLuint, CreateShader, (GLenum type)) \
514 F(GLuint, CreateProgram, ()) \
515 F(void, CompileShader, (GLuint shader)) \
516 F(void, BindAttribLocation, (GLuint program, GLuint index, const GLchar *name)) \
517 F(void, AttachShader, (GLuint program, GLuint shader)) \
518 F(void, StencilMaskSeparate, (GLenum face, GLuint mask)) \
519 F(void, StencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask)) \
520 F(void, StencilOpSeparate, (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)) \
521 F(void, DrawBuffers, (GLsizei n, const GLenum *bufs)) \
522 F(void, BlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha)) \
523 F(void, VertexAttrib4usv, (GLuint index, const GLushort *v)) \
524 F(void, VertexAttrib4uiv, (GLuint index, const GLuint *v)) \
525 F(void, VertexAttrib4ubv, (GLuint index, const GLubyte *v)) \
526 F(void, VertexAttrib4sv, (GLuint index, const GLshort *v)) \
527 F(void, VertexAttrib4s, (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)) \
528 F(void, VertexAttrib4iv, (GLuint index, const GLint *v)) \
529 F(void, VertexAttrib4fv, (GLuint index, const GLfloat *v)) \
530 F(void, VertexAttrib4f, (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) \
531 F(void, VertexAttrib4dv, (GLuint index, const GLdouble *v)) \
532 F(void, VertexAttrib4d, (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) \
533 F(void, VertexAttrib4bv, (GLuint index, const GLbyte *v)) \
534 F(void, VertexAttrib4Nusv, (GLuint index, const GLushort *v)) \
535 F(void, VertexAttrib4Nuiv, (GLuint index, const GLuint *v)) \
536 F(void, VertexAttrib4Nubv, (GLuint index, const GLubyte *v)) \
537 F(void, VertexAttrib4Nub, (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) \
538 F(void, VertexAttrib4Nsv, (GLuint index, const GLshort *v)) \
539 F(void, VertexAttrib4Niv, (GLuint index, const GLint *v)) \
540 F(void, VertexAttrib4Nbv, (GLuint index, const GLbyte *v)) \
541 F(void, VertexAttrib3sv, (GLuint index, const GLshort *v)) \
542 F(void, VertexAttrib3s, (GLuint index, GLshort x, GLshort y, GLshort z)) \
543 F(void, VertexAttrib3fv, (GLuint index, const GLfloat *v)) \
544 F(void, VertexAttrib3f, (GLuint index, GLfloat x, GLfloat y, GLfloat z)) \
545 F(void, VertexAttrib3dv, (GLuint index, const GLdouble *v)) \
546 F(void, VertexAttrib3d, (GLuint index, GLdouble x, GLdouble y, GLdouble z)) \
547 F(void, VertexAttrib2sv, (GLuint index, const GLshort *v)) \
548 F(void, VertexAttrib2s, (GLuint index, GLshort x, GLshort y)) \
549 F(void, VertexAttrib2fv, (GLuint index, const GLfloat *v)) \
550 F(void, VertexAttrib2f, (GLuint index, GLfloat x, GLfloat y)) \
551 F(void, VertexAttrib2dv, (GLuint index, const GLdouble *v)) \
552 F(void, VertexAttrib2d, (GLuint index, GLdouble x, GLdouble y)) \
553 F(void, VertexAttrib1sv, (GLuint index, const GLshort *v)) \
554 F(void, VertexAttrib1s, (GLuint index, GLshort x)) \
555 F(void, VertexAttrib1fv, (GLuint index, const GLfloat *v)) \
556 F(void, VertexAttrib1f, (GLuint index, GLfloat x)) \
557 F(void, VertexAttrib1dv, (GLuint index, const GLdouble *v)) \
558 F(void, VertexAttrib1d, (GLuint index, GLdouble x)) \
559
560 QT_OPENGL_DECLARE(QT_OPENGL_2_0_FUNCTIONS);
561};
562
563class QOpenGLFunctions_2_1_CoreBackend : public QOpenGLVersionFunctionsBackend
564{
565public:
566 QOpenGLFunctions_2_1_CoreBackend(QOpenGLContext *c)
567 : QOpenGLVersionFunctionsBackend(c)
568 {
569 init();
570 }
571
572 Q_DECL_CONSTEXPR static Version versionStatus()
573 { return OpenGL_2_1_Core; }
574
575 // OpenGL 2.1 core functions
576#define QT_OPENGL_2_1_FUNCTIONS(F) \
577 F(void, UniformMatrix4x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
578 F(void, UniformMatrix3x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
579 F(void, UniformMatrix4x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
580 F(void, UniformMatrix2x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
581 F(void, UniformMatrix3x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
582 F(void, UniformMatrix2x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
583
584 QT_OPENGL_DECLARE(QT_OPENGL_2_1_FUNCTIONS);
585};
586
587class QOpenGLFunctions_3_0_CoreBackend : public QOpenGLVersionFunctionsBackend
588{
589public:
590 QOpenGLFunctions_3_0_CoreBackend(QOpenGLContext *c)
591 : QOpenGLVersionFunctionsBackend(c)
592 {
593 init();
594 }
595
596 Q_DECL_CONSTEXPR static Version versionStatus()
597 { return OpenGL_3_0_Core; }
598
599 // OpenGL 3.0 core functions
600#define QT_OPENGL_3_0_FUNCTIONS(F) \
601 F(GLboolean, IsVertexArray, (GLuint array)) \
602 F(void, GenVertexArrays, (GLsizei n, GLuint *arrays)) \
603 F(void, DeleteVertexArrays, (GLsizei n, const GLuint *arrays)) \
604 F(void, BindVertexArray, (GLuint array)) \
605 F(void, FlushMappedBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length)) \
606 F(GLvoid *, MapBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)) \
607 F(void, FramebufferTextureLayer, (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)) \
608 F(void, RenderbufferStorageMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) \
609 F(void, BlitFramebuffer, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)) \
610 F(void, GenerateMipmap, (GLenum target)) \
611 F(void, GetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint *params)) \
612 F(void, FramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) \
613 F(void, FramebufferTexture3D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) \
614 F(void, FramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) \
615 F(void, FramebufferTexture1D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) \
616 F(GLenum, CheckFramebufferStatus, (GLenum target)) \
617 F(void, GenFramebuffers, (GLsizei n, GLuint *framebuffers)) \
618 F(void, DeleteFramebuffers, (GLsizei n, const GLuint *framebuffers)) \
619 F(void, BindFramebuffer, (GLenum target, GLuint framebuffer)) \
620 F(GLboolean, IsFramebuffer, (GLuint framebuffer)) \
621 F(void, GetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint *params)) \
622 F(void, RenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) \
623 F(void, GenRenderbuffers, (GLsizei n, GLuint *renderbuffers)) \
624 F(void, DeleteRenderbuffers, (GLsizei n, const GLuint *renderbuffers)) \
625 F(void, BindRenderbuffer, (GLenum target, GLuint renderbuffer)) \
626 F(GLboolean, IsRenderbuffer, (GLuint renderbuffer)) \
627 F(const GLubyte *, GetStringi, (GLenum name, GLuint index)) \
628 F(void, ClearBufferfi, (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)) \
629 F(void, ClearBufferfv, (GLenum buffer, GLint drawbuffer, const GLfloat *value)) \
630 F(void, ClearBufferuiv, (GLenum buffer, GLint drawbuffer, const GLuint *value)) \
631 F(void, ClearBufferiv, (GLenum buffer, GLint drawbuffer, const GLint *value)) \
632 F(void, GetTexParameterIuiv, (GLenum target, GLenum pname, GLuint *params)) \
633 F(void, GetTexParameterIiv, (GLenum target, GLenum pname, GLint *params)) \
634 F(void, TexParameterIuiv, (GLenum target, GLenum pname, const GLuint *params)) \
635 F(void, TexParameterIiv, (GLenum target, GLenum pname, const GLint *params)) \
636 F(void, Uniform4uiv, (GLint location, GLsizei count, const GLuint *value)) \
637 F(void, Uniform3uiv, (GLint location, GLsizei count, const GLuint *value)) \
638 F(void, Uniform2uiv, (GLint location, GLsizei count, const GLuint *value)) \
639 F(void, Uniform1uiv, (GLint location, GLsizei count, const GLuint *value)) \
640 F(void, Uniform4ui, (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)) \
641 F(void, Uniform3ui, (GLint location, GLuint v0, GLuint v1, GLuint v2)) \
642 F(void, Uniform2ui, (GLint location, GLuint v0, GLuint v1)) \
643 F(void, Uniform1ui, (GLint location, GLuint v0)) \
644 F(GLint, GetFragDataLocation, (GLuint program, const GLchar *name)) \
645 F(void, BindFragDataLocation, (GLuint program, GLuint color, const GLchar *name)) \
646 F(void, GetUniformuiv, (GLuint program, GLint location, GLuint *params)) \
647 F(void, GetVertexAttribIuiv, (GLuint index, GLenum pname, GLuint *params)) \
648 F(void, GetVertexAttribIiv, (GLuint index, GLenum pname, GLint *params)) \
649 F(void, VertexAttribIPointer, (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) \
650 F(void, EndConditionalRender, ()) \
651 F(void, BeginConditionalRender, (GLuint id, GLenum mode)) \
652 F(void, ClampColor, (GLenum target, GLenum clamp)) \
653 F(void, GetTransformFeedbackVarying, (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)) \
654 F(void, TransformFeedbackVaryings, (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode)) \
655 F(void, BindBufferBase, (GLenum target, GLuint index, GLuint buffer)) \
656 F(void, BindBufferRange, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)) \
657 F(void, EndTransformFeedback, ()) \
658 F(void, BeginTransformFeedback, (GLenum primitiveMode)) \
659 F(GLboolean, IsEnabledi, (GLenum target, GLuint index)) \
660 F(void, Disablei, (GLenum target, GLuint index)) \
661 F(void, Enablei, (GLenum target, GLuint index)) \
662 F(void, GetIntegeri_v,(GLenum target, GLuint index, GLint *data)) \
663 F(void, GetBooleani_v,(GLenum target, GLuint index, GLboolean *data)) \
664 F(void, ColorMaski, (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a)) \
665 F(void, VertexAttribI4usv, (GLuint index, const GLushort *v)) \
666 F(void, VertexAttribI4ubv, (GLuint index, const GLubyte *v)) \
667 F(void, VertexAttribI4sv, (GLuint index, const GLshort *v)) \
668 F(void, VertexAttribI4bv, (GLuint index, const GLbyte *v)) \
669 F(void, VertexAttribI4uiv, (GLuint index, const GLuint *v)) \
670 F(void, VertexAttribI3uiv, (GLuint index, const GLuint *v)) \
671 F(void, VertexAttribI2uiv, (GLuint index, const GLuint *v)) \
672 F(void, VertexAttribI1uiv, (GLuint index, const GLuint *v)) \
673 F(void, VertexAttribI4iv, (GLuint index, const GLint *v)) \
674 F(void, VertexAttribI3iv, (GLuint index, const GLint *v)) \
675 F(void, VertexAttribI2iv, (GLuint index, const GLint *v)) \
676 F(void, VertexAttribI1iv, (GLuint index, const GLint *v)) \
677 F(void, VertexAttribI4ui, (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)) \
678 F(void, VertexAttribI3ui, (GLuint index, GLuint x, GLuint y, GLuint z)) \
679 F(void, VertexAttribI2ui, (GLuint index, GLuint x, GLuint y)) \
680 F(void, VertexAttribI1ui, (GLuint index, GLuint x)) \
681 F(void, VertexAttribI4i, (GLuint index, GLint x, GLint y, GLint z, GLint w)) \
682 F(void, VertexAttribI3i, (GLuint index, GLint x, GLint y, GLint z)) \
683 F(void, VertexAttribI2i, (GLuint index, GLint x, GLint y)) \
684 F(void, VertexAttribI1i, (GLuint index, GLint x)) \
685
686 QT_OPENGL_DECLARE(QT_OPENGL_3_0_FUNCTIONS);
687};
688
689class QOpenGLFunctions_3_1_CoreBackend : public QOpenGLVersionFunctionsBackend
690{
691public:
692 QOpenGLFunctions_3_1_CoreBackend(QOpenGLContext *c)
693 : QOpenGLVersionFunctionsBackend(c)
694 {
695 init();
696 }
697
698 Q_DECL_CONSTEXPR static Version versionStatus()
699 { return OpenGL_3_1_Core; }
700
701 // OpenGL 3.1 core functions
702#define QT_OPENGL_3_1_FUNCTIONS(F) \
703 F(void, CopyBufferSubData, (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)) \
704 F(void, UniformBlockBinding, (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)) \
705 F(void, GetActiveUniformBlockName, (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName)) \
706 F(void, GetActiveUniformBlockiv, (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params)) \
707 F(GLuint, GetUniformBlockIndex, (GLuint program, const GLchar *uniformBlockName)) \
708 F(void, GetActiveUniformName, (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName)) \
709 F(void, GetActiveUniformsiv, (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params)) \
710 F(void, GetUniformIndices, (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices)) \
711 F(void, PrimitiveRestartIndex, (GLuint index)) \
712 F(void, TexBuffer, (GLenum target, GLenum internalformat, GLuint buffer)) \
713 F(void, DrawElementsInstanced, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount)) \
714 F(void, DrawArraysInstanced, (GLenum mode, GLint first, GLsizei count, GLsizei instancecount)) \
715
716 QT_OPENGL_DECLARE(QT_OPENGL_3_1_FUNCTIONS);
717};
718
719class QOpenGLFunctions_3_2_CoreBackend : public QOpenGLVersionFunctionsBackend
720{
721public:
722 QOpenGLFunctions_3_2_CoreBackend(QOpenGLContext *c)
723 : QOpenGLVersionFunctionsBackend(c)
724 {
725 init();
726 }
727
728 Q_DECL_CONSTEXPR static Version versionStatus()
729 { return OpenGL_3_2_Core; }
730
731 // OpenGL 3.2 core functions
732#define QT_OPENGL_3_2_FUNCTIONS(F) \
733 F(void, SampleMaski, (GLuint maskNumber, GLbitfield mask)) \
734 F(void, GetMultisamplefv, (GLenum pname, GLuint index, GLfloat *val)) \
735 F(void, TexImage3DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)) \
736 F(void, TexImage2DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)) \
737 F(void, GetSynciv, (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)) \
738 F(void, GetInteger64v, (GLenum pname, GLint64 *data)) \
739 F(void, WaitSync, (GLsync sync, GLbitfield flags, GLuint64 timeout)) \
740 F(GLenum, ClientWaitSync, (GLsync sync, GLbitfield flags, GLuint64 timeout)) \
741 F(void, DeleteSync, (GLsync sync)) \
742 F(GLboolean, IsSync, (GLsync sync)) \
743 F(GLsync, FenceSync, (GLenum condition, GLbitfield flags)) \
744 F(void, ProvokingVertex, (GLenum mode)) \
745 F(void, MultiDrawElementsBaseVertex, (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex)) \
746 F(void, DrawElementsInstancedBaseVertex, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex)) \
747 F(void, DrawRangeElementsBaseVertex, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)) \
748 F(void, DrawElementsBaseVertex, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)) \
749 F(void, FramebufferTexture, (GLenum target, GLenum attachment, GLuint texture, GLint level)) \
750 F(void, GetBufferParameteri64v, (GLenum target, GLenum pname, GLint64 *params)) \
751 F(void, GetInteger64i_v,(GLenum target, GLuint index, GLint64 *data))
752
753 QT_OPENGL_DECLARE(QT_OPENGL_3_2_FUNCTIONS);
754};
755
756class QOpenGLFunctions_3_3_CoreBackend : public QOpenGLVersionFunctionsBackend
757{
758public:
759 QOpenGLFunctions_3_3_CoreBackend(QOpenGLContext *c)
760 : QOpenGLVersionFunctionsBackend(c)
761 {
762 init();
763 }
764
765 Q_DECL_CONSTEXPR static Version versionStatus()
766 { return OpenGL_3_3_Core; }
767
768 // OpenGL 3.3 core functions
769#define QT_OPENGL_3_3_FUNCTIONS(F) \
770 F(void, VertexAttribP4uiv, (GLuint index, GLenum type, GLboolean normalized, const GLuint *value)) \
771 F(void, VertexAttribP4ui, (GLuint index, GLenum type, GLboolean normalized, GLuint value)) \
772 F(void, VertexAttribP3uiv, (GLuint index, GLenum type, GLboolean normalized, const GLuint *value)) \
773 F(void, VertexAttribP3ui, (GLuint index, GLenum type, GLboolean normalized, GLuint value)) \
774 F(void, VertexAttribP2uiv, (GLuint index, GLenum type, GLboolean normalized, const GLuint *value)) \
775 F(void, VertexAttribP2ui, (GLuint index, GLenum type, GLboolean normalized, GLuint value)) \
776 F(void, VertexAttribP1uiv, (GLuint index, GLenum type, GLboolean normalized, const GLuint *value)) \
777 F(void, VertexAttribP1ui, (GLuint index, GLenum type, GLboolean normalized, GLuint value)) \
778 F(void, SecondaryColorP3uiv, (GLenum type, const GLuint *color)) \
779 F(void, SecondaryColorP3ui, (GLenum type, GLuint color)) \
780 F(void, ColorP4uiv, (GLenum type, const GLuint *color)) \
781 F(void, ColorP4ui, (GLenum type, GLuint color)) \
782 F(void, ColorP3uiv, (GLenum type, const GLuint *color)) \
783 F(void, ColorP3ui, (GLenum type, GLuint color)) \
784 F(void, NormalP3uiv, (GLenum type, const GLuint *coords)) \
785 F(void, NormalP3ui, (GLenum type, GLuint coords)) \
786 F(void, MultiTexCoordP4uiv, (GLenum texture, GLenum type, const GLuint *coords)) \
787 F(void, MultiTexCoordP4ui, (GLenum texture, GLenum type, GLuint coords)) \
788 F(void, MultiTexCoordP3uiv, (GLenum texture, GLenum type, const GLuint *coords)) \
789 F(void, MultiTexCoordP3ui, (GLenum texture, GLenum type, GLuint coords)) \
790 F(void, MultiTexCoordP2uiv, (GLenum texture, GLenum type, const GLuint *coords)) \
791 F(void, MultiTexCoordP2ui, (GLenum texture, GLenum type, GLuint coords)) \
792 F(void, MultiTexCoordP1uiv, (GLenum texture, GLenum type, const GLuint *coords)) \
793 F(void, MultiTexCoordP1ui, (GLenum texture, GLenum type, GLuint coords)) \
794 F(void, TexCoordP4uiv, (GLenum type, const GLuint *coords)) \
795 F(void, TexCoordP4ui, (GLenum type, GLuint coords)) \
796 F(void, TexCoordP3uiv, (GLenum type, const GLuint *coords)) \
797 F(void, TexCoordP3ui, (GLenum type, GLuint coords)) \
798 F(void, TexCoordP2uiv, (GLenum type, const GLuint *coords)) \
799 F(void, TexCoordP2ui, (GLenum type, GLuint coords)) \
800 F(void, TexCoordP1uiv, (GLenum type, const GLuint *coords)) \
801 F(void, TexCoordP1ui, (GLenum type, GLuint coords)) \
802 F(void, VertexP4uiv, (GLenum type, const GLuint *value)) \
803 F(void, VertexP4ui, (GLenum type, GLuint value)) \
804 F(void, VertexP3uiv, (GLenum type, const GLuint *value)) \
805 F(void, VertexP3ui, (GLenum type, GLuint value)) \
806 F(void, VertexP2uiv, (GLenum type, const GLuint *value)) \
807 F(void, VertexP2ui, (GLenum type, GLuint value)) \
808 F(void, GetQueryObjectui64v, (GLuint id, GLenum pname, GLuint64 *params)) \
809 F(void, GetQueryObjecti64v, (GLuint id, GLenum pname, GLint64 *params)) \
810 F(void, QueryCounter, (GLuint id, GLenum target)) \
811 F(void, GetSamplerParameterIuiv, (GLuint sampler, GLenum pname, GLuint *params)) \
812 F(void, GetSamplerParameterfv, (GLuint sampler, GLenum pname, GLfloat *params)) \
813 F(void, GetSamplerParameterIiv, (GLuint sampler, GLenum pname, GLint *params)) \
814 F(void, GetSamplerParameteriv, (GLuint sampler, GLenum pname, GLint *params)) \
815 F(void, SamplerParameterIuiv, (GLuint sampler, GLenum pname, const GLuint *param)) \
816 F(void, SamplerParameterIiv, (GLuint sampler, GLenum pname, const GLint *param)) \
817 F(void, SamplerParameterfv, (GLuint sampler, GLenum pname, const GLfloat *param)) \
818 F(void, SamplerParameterf, (GLuint sampler, GLenum pname, GLfloat param)) \
819 F(void, SamplerParameteriv, (GLuint sampler, GLenum pname, const GLint *param)) \
820 F(void, SamplerParameteri, (GLuint sampler, GLenum pname, GLint param)) \
821 F(void, BindSampler, (GLuint unit, GLuint sampler)) \
822 F(GLboolean, IsSampler, (GLuint sampler)) \
823 F(void, DeleteSamplers, (GLsizei count, const GLuint *samplers)) \
824 F(void, GenSamplers, (GLsizei count, GLuint *samplers)) \
825 F(GLint, GetFragDataIndex, (GLuint program, const GLchar *name)) \
826 F(void, BindFragDataLocationIndexed, (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name)) \
827 F(void, VertexAttribDivisor, (GLuint index, GLuint divisor)) \
828
829 QT_OPENGL_DECLARE(QT_OPENGL_3_3_FUNCTIONS);
830};
831
832class QOpenGLFunctions_4_0_CoreBackend : public QOpenGLVersionFunctionsBackend
833{
834public:
835 QOpenGLFunctions_4_0_CoreBackend(QOpenGLContext *c)
836 : QOpenGLVersionFunctionsBackend(c)
837 {
838 init();
839 }
840
841 Q_DECL_CONSTEXPR static Version versionStatus()
842 { return OpenGL_4_0_Core; }
843
844 // OpenGL 4.0 core functions
845#define QT_OPENGL_4_0_FUNCTIONS(F) \
846 F(void, GetQueryIndexediv, (GLenum target, GLuint index, GLenum pname, GLint *params)) \
847 F(void, EndQueryIndexed, (GLenum target, GLuint index)) \
848 F(void, BeginQueryIndexed, (GLenum target, GLuint index, GLuint id)) \
849 F(void, DrawTransformFeedbackStream, (GLenum mode, GLuint id, GLuint stream)) \
850 F(void, DrawTransformFeedback, (GLenum mode, GLuint id)) \
851 F(void, ResumeTransformFeedback, ()) \
852 F(void, PauseTransformFeedback, ()) \
853 F(GLboolean, IsTransformFeedback, (GLuint id)) \
854 F(void, GenTransformFeedbacks, (GLsizei n, GLuint *ids)) \
855 F(void, DeleteTransformFeedbacks, (GLsizei n, const GLuint *ids)) \
856 F(void, BindTransformFeedback, (GLenum target, GLuint id)) \
857 F(void, PatchParameterfv, (GLenum pname, const GLfloat *values)) \
858 F(void, PatchParameteri, (GLenum pname, GLint value)) \
859 F(void, GetProgramStageiv, (GLuint program, GLenum shadertype, GLenum pname, GLint *values)) \
860 F(void, GetUniformSubroutineuiv, (GLenum shadertype, GLint location, GLuint *params)) \
861 F(void, UniformSubroutinesuiv, (GLenum shadertype, GLsizei count, const GLuint *indices)) \
862 F(void, GetActiveSubroutineName, (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name)) \
863 F(void, GetActiveSubroutineUniformName, (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name)) \
864 F(void, GetActiveSubroutineUniformiv, (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values)) \
865 F(GLuint, GetSubroutineIndex, (GLuint program, GLenum shadertype, const GLchar *name)) \
866 F(GLint, GetSubroutineUniformLocation, (GLuint program, GLenum shadertype, const GLchar *name)) \
867 F(void, GetUniformdv, (GLuint program, GLint location, GLdouble *params)) \
868 F(void, UniformMatrix4x3dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
869 F(void, UniformMatrix4x2dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
870 F(void, UniformMatrix3x4dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
871 F(void, UniformMatrix3x2dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
872 F(void, UniformMatrix2x4dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
873 F(void, UniformMatrix2x3dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
874 F(void, UniformMatrix4dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
875 F(void, UniformMatrix3dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
876 F(void, UniformMatrix2dv, (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
877 F(void, Uniform4dv, (GLint location, GLsizei count, const GLdouble *value)) \
878 F(void, Uniform3dv, (GLint location, GLsizei count, const GLdouble *value)) \
879 F(void, Uniform2dv, (GLint location, GLsizei count, const GLdouble *value)) \
880 F(void, Uniform1dv, (GLint location, GLsizei count, const GLdouble *value)) \
881 F(void, Uniform4d, (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) \
882 F(void, Uniform3d, (GLint location, GLdouble x, GLdouble y, GLdouble z)) \
883 F(void, Uniform2d, (GLint location, GLdouble x, GLdouble y)) \
884 F(void, Uniform1d, (GLint location, GLdouble x)) \
885 F(void, DrawElementsIndirect, (GLenum mode, GLenum type, const GLvoid *indirect)) \
886 F(void, DrawArraysIndirect, (GLenum mode, const GLvoid *indirect)) \
887 F(void, BlendFuncSeparatei, (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)) \
888 F(void, BlendFunci, (GLuint buf, GLenum src, GLenum dst)) \
889 F(void, BlendEquationSeparatei, (GLuint buf, GLenum modeRGB, GLenum modeAlpha)) \
890 F(void, BlendEquationi, (GLuint buf, GLenum mode)) \
891 F(void, MinSampleShading, (GLfloat value)) \
892
893 QT_OPENGL_DECLARE(QT_OPENGL_4_0_FUNCTIONS);
894};
895
896class QOpenGLFunctions_4_1_CoreBackend : public QOpenGLVersionFunctionsBackend
897{
898public:
899 QOpenGLFunctions_4_1_CoreBackend(QOpenGLContext *c)
900 : QOpenGLVersionFunctionsBackend(c)
901 {
902 init();
903 }
904
905 Q_DECL_CONSTEXPR static Version versionStatus()
906 { return OpenGL_4_1_Core; }
907
908 // OpenGL 4.1 core functions
909#define QT_OPENGL_4_1_FUNCTIONS(F) \
910 F(void, GetDoublei_v, (GLenum target, GLuint index, GLdouble *data)) \
911 F(void, GetFloati_v,(GLenum target, GLuint index, GLfloat *data)) \
912 F(void, DepthRangeIndexed, (GLuint index, GLdouble n, GLdouble f)) \
913 F(void, DepthRangeArrayv, (GLuint first, GLsizei count, const GLdouble *v)) \
914 F(void, ScissorIndexedv, (GLuint index, const GLint *v)) \
915 F(void, ScissorIndexed, (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height)) \
916 F(void, ScissorArrayv, (GLuint first, GLsizei count, const GLint *v)) \
917 F(void, ViewportIndexedfv, (GLuint index, const GLfloat *v)) \
918 F(void, ViewportIndexedf, (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h)) \
919 F(void, ViewportArrayv, (GLuint first, GLsizei count, const GLfloat *v)) \
920 F(void, GetVertexAttribLdv, (GLuint index, GLenum pname, GLdouble *params)) \
921 F(void, VertexAttribLPointer, (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) \
922 F(void, VertexAttribL4dv, (GLuint index, const GLdouble *v)) \
923 F(void, VertexAttribL3dv, (GLuint index, const GLdouble *v)) \
924 F(void, VertexAttribL2dv, (GLuint index, const GLdouble *v)) \
925 F(void, VertexAttribL1dv, (GLuint index, const GLdouble *v)) \
926 F(void, VertexAttribL4d, (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) \
927 F(void, VertexAttribL3d, (GLuint index, GLdouble x, GLdouble y, GLdouble z)) \
928 F(void, VertexAttribL2d, (GLuint index, GLdouble x, GLdouble y)) \
929 F(void, VertexAttribL1d, (GLuint index, GLdouble x)) \
930 F(void, GetProgramPipelineInfoLog, (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) \
931 F(void, ValidateProgramPipeline, (GLuint pipeline)) \
932 F(void, ProgramUniformMatrix4x3dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
933 F(void, ProgramUniformMatrix3x4dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
934 F(void, ProgramUniformMatrix4x2dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
935 F(void, ProgramUniformMatrix2x4dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
936 F(void, ProgramUniformMatrix3x2dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
937 F(void, ProgramUniformMatrix2x3dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
938 F(void, ProgramUniformMatrix4x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
939 F(void, ProgramUniformMatrix3x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
940 F(void, ProgramUniformMatrix4x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
941 F(void, ProgramUniformMatrix2x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
942 F(void, ProgramUniformMatrix3x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
943 F(void, ProgramUniformMatrix2x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
944 F(void, ProgramUniformMatrix4dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
945 F(void, ProgramUniformMatrix3dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
946 F(void, ProgramUniformMatrix2dv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value)) \
947 F(void, ProgramUniformMatrix4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
948 F(void, ProgramUniformMatrix3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
949 F(void, ProgramUniformMatrix2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) \
950 F(void, ProgramUniform4uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) \
951 F(void, ProgramUniform4ui, (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)) \
952 F(void, ProgramUniform4dv, (GLuint program, GLint location, GLsizei count, const GLdouble *value)) \
953 F(void, ProgramUniform4d, (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3)) \
954 F(void, ProgramUniform4fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) \
955 F(void, ProgramUniform4f, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) \
956 F(void, ProgramUniform4iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) \
957 F(void, ProgramUniform4i, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) \
958 F(void, ProgramUniform3uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) \
959 F(void, ProgramUniform3ui, (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)) \
960 F(void, ProgramUniform3dv, (GLuint program, GLint location, GLsizei count, const GLdouble *value)) \
961 F(void, ProgramUniform3d, (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2)) \
962 F(void, ProgramUniform3fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) \
963 F(void, ProgramUniform3f, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) \
964 F(void, ProgramUniform3iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) \
965 F(void, ProgramUniform3i, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2)) \
966 F(void, ProgramUniform2uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) \
967 F(void, ProgramUniform2ui, (GLuint program, GLint location, GLuint v0, GLuint v1)) \
968 F(void, ProgramUniform2dv, (GLuint program, GLint location, GLsizei count, const GLdouble *value)) \
969 F(void, ProgramUniform2d, (GLuint program, GLint location, GLdouble v0, GLdouble v1)) \
970 F(void, ProgramUniform2fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) \
971 F(void, ProgramUniform2f, (GLuint program, GLint location, GLfloat v0, GLfloat v1)) \
972 F(void, ProgramUniform2iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) \
973 F(void, ProgramUniform2i, (GLuint program, GLint location, GLint v0, GLint v1)) \
974 F(void, ProgramUniform1uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) \
975 F(void, ProgramUniform1ui, (GLuint program, GLint location, GLuint v0)) \
976 F(void, ProgramUniform1dv, (GLuint program, GLint location, GLsizei count, const GLdouble *value)) \
977 F(void, ProgramUniform1d, (GLuint program, GLint location, GLdouble v0)) \
978 F(void, ProgramUniform1fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) \
979 F(void, ProgramUniform1f, (GLuint program, GLint location, GLfloat v0)) \
980 F(void, ProgramUniform1iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) \
981 F(void, ProgramUniform1i, (GLuint program, GLint location, GLint v0)) \
982 F(void, GetProgramPipelineiv, (GLuint pipeline, GLenum pname, GLint *params)) \
983 F(GLboolean, IsProgramPipeline, (GLuint pipeline)) \
984 F(void, GenProgramPipelines, (GLsizei n, GLuint *pipelines)) \
985 F(void, DeleteProgramPipelines, (GLsizei n, const GLuint *pipelines)) \
986 F(void, BindProgramPipeline, (GLuint pipeline)) \
987 F(GLuint, CreateShaderProgramv, (GLenum type, GLsizei count, const GLchar* const *strings)) \
988 F(void, ActiveShaderProgram, (GLuint pipeline, GLuint program)) \
989 F(void, UseProgramStages, (GLuint pipeline, GLbitfield stages, GLuint program)) \
990 F(void, ProgramParameteri, (GLuint program, GLenum pname, GLint value)) \
991 F(void, ProgramBinary, (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length)) \
992 F(void, GetProgramBinary, (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)) \
993 F(void, ClearDepthf, (GLfloat dd)) \
994 F(void, DepthRangef, (GLfloat n, GLfloat f)) \
995 F(void, GetShaderPrecisionFormat, (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)) \
996 F(void, ShaderBinary, (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length)) \
997 F(void, ReleaseShaderCompiler, ()) \
998
999 QT_OPENGL_DECLARE(QT_OPENGL_4_1_FUNCTIONS);
1000};
1001
1002class QOpenGLFunctions_4_2_CoreBackend : public QOpenGLVersionFunctionsBackend
1003{
1004public:
1005 QOpenGLFunctions_4_2_CoreBackend(QOpenGLContext *c)
1006 : QOpenGLVersionFunctionsBackend(c)
1007 {
1008 init();
1009 }
1010
1011 Q_DECL_CONSTEXPR static Version versionStatus()
1012 { return OpenGL_4_2_Core; }
1013
1014 // OpenGL 4.2 core functions
1015#define QT_OPENGL_4_2_FUNCTIONS(F) \
1016 F(void, TexStorage3D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)) \
1017 F(void, TexStorage2D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)) \
1018 F(void, TexStorage1D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)) \
1019 F(void, MemoryBarrier, (GLbitfield barriers)) \
1020 F(void, BindImageTexture, (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)) \
1021 F(void, GetActiveAtomicCounterBufferiv, (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params)) \
1022 F(void, GetInternalformativ, (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params)) \
1023 F(void, DrawTransformFeedbackStreamInstanced, (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount)) \
1024 F(void, DrawTransformFeedbackInstanced, (GLenum mode, GLuint id, GLsizei instancecount)) \
1025 F(void, DrawElementsInstancedBaseVertexBaseInstance, (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance)) \
1026 F(void, DrawElementsInstancedBaseInstance, (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance)) \
1027 F(void, DrawArraysInstancedBaseInstance, (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance)) \
1028
1029 QT_OPENGL_DECLARE(QT_OPENGL_4_2_FUNCTIONS);
1030};
1031
1032class QOpenGLFunctions_4_3_CoreBackend : public QOpenGLVersionFunctionsBackend
1033{
1034public:
1035 QOpenGLFunctions_4_3_CoreBackend(QOpenGLContext *c)
1036 : QOpenGLVersionFunctionsBackend(c)
1037 {
1038 init();
1039 }
1040
1041 Q_DECL_CONSTEXPR static Version versionStatus()
1042 { return OpenGL_4_3_Core; }
1043
1044 // OpenGL 4.3 core functions
1045#define QT_OPENGL_4_3_FUNCTIONS(F) \
1046 F(void, TexStorage3DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)) \
1047 F(void, TexStorage2DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)) \
1048 F(void, TexBufferRange, (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)) \
1049 F(void, ShaderStorageBlockBinding, (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding)) \
1050 F(GLint, GetProgramResourceLocationIndex, (GLuint program, GLenum programInterface, const GLchar *name)) \
1051 F(GLint, GetProgramResourceLocation, (GLuint program, GLenum programInterface, const GLchar *name)) \
1052 F(void, GetProgramResourceiv, (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params)) \
1053 F(void, GetProgramResourceName, (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name)) \
1054 F(GLuint, GetProgramResourceIndex, (GLuint program, GLenum programInterface, const GLchar *name)) \
1055 F(void, GetProgramInterfaceiv, (GLuint program, GLenum programInterface, GLenum pname, GLint *params)) \
1056 F(void, MultiDrawElementsIndirect, (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride)) \
1057 F(void, MultiDrawArraysIndirect, (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride)) \
1058 F(void, InvalidateSubFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height)) \
1059 F(void, InvalidateFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum *attachments)) \
1060 F(void, InvalidateBufferData, (GLuint buffer)) \
1061 F(void, InvalidateBufferSubData, (GLuint buffer, GLintptr offset, GLsizeiptr length)) \
1062 F(void, InvalidateTexImage, (GLuint texture, GLint level)) \
1063 F(void, InvalidateTexSubImage, (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth)) \
1064 F(void, GetInternalformati64v, (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params)) \
1065 F(void, GetFramebufferParameteriv, (GLenum target, GLenum pname, GLint *params)) \
1066 F(void, FramebufferParameteri, (GLenum target, GLenum pname, GLint param)) \
1067 F(void, VertexBindingDivisor, (GLuint bindingindex, GLuint divisor)) \
1068 F(void, VertexAttribBinding, (GLuint attribindex, GLuint bindingindex)) \
1069 F(void, VertexAttribLFormat, (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)) \
1070 F(void, VertexAttribIFormat, (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)) \
1071 F(void, VertexAttribFormat, (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)) \
1072 F(void, BindVertexBuffer, (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)) \
1073 F(void, TextureView, (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers)) \
1074 F(void, CopyImageSubData, (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)) \
1075 F(void, DispatchComputeIndirect, (GLintptr indirect)) \
1076 F(void, DispatchCompute, (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)) \
1077 F(void, ClearBufferSubData, (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data)) \
1078 F(void, ClearBufferData, (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data)) \
1079 F(void, GetObjectPtrLabel, (const GLvoid *ptr, GLsizei bufSize, GLsizei *length, GLchar *label)) \
1080 F(void, ObjectPtrLabel, (const GLvoid *ptr, GLsizei length, const GLchar *label)) \
1081 F(void, GetObjectLabel, (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label)) \
1082 F(void, ObjectLabel, (GLenum identifier, GLuint name, GLsizei length, const GLchar *label)) \
1083 F(void, PopDebugGroup, ()) \
1084 F(void, PushDebugGroup, (GLenum source, GLuint id, GLsizei length, const GLchar *message)) \
1085 F(GLuint, GetDebugMessageLog, (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog)) \
1086 F(void, DebugMessageCallback, (GLDEBUGPROC callback, const GLvoid *userParam)) \
1087 F(void, DebugMessageInsert, (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf)) \
1088 F(void, DebugMessageControl, (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled)) \
1089
1090 QT_OPENGL_DECLARE(QT_OPENGL_4_3_FUNCTIONS);
1091};
1092
1093class QOpenGLFunctions_4_4_CoreBackend : public QOpenGLVersionFunctionsBackend
1094{
1095public:
1096 QOpenGLFunctions_4_4_CoreBackend(QOpenGLContext *c)
1097 : QOpenGLVersionFunctionsBackend(c)
1098 {
1099 init();
1100 }
1101
1102 Q_DECL_CONSTEXPR static Version versionStatus()
1103 { return OpenGL_4_4_Core; }
1104
1105 // OpenGL 4.4 core functions
1106#define QT_OPENGL_4_4_FUNCTIONS(F) \
1107 F(void, BindVertexBuffers, (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides)) \
1108 F(void, BindImageTextures, (GLuint first, GLsizei count, const GLuint *textures)) \
1109 F(void, BindSamplers, (GLuint first, GLsizei count, const GLuint *samplers)) \
1110 F(void, BindTextures, (GLuint first, GLsizei count, const GLuint *textures)) \
1111 F(void, BindBuffersRange, (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes)) \
1112 F(void, BindBuffersBase, (GLenum target, GLuint first, GLsizei count, const GLuint *buffers)) \
1113 F(void, ClearTexSubImage, (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data)) \
1114 F(void, ClearTexImage, (GLuint texture, GLint level, GLenum format, GLenum type, const void *data)) \
1115 F(void, BufferStorage, (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags)) \
1116
1117 QT_OPENGL_DECLARE(QT_OPENGL_4_4_FUNCTIONS);
1118};
1119
1120class QOpenGLFunctions_4_5_CoreBackend : public QOpenGLVersionFunctionsBackend
1121{
1122public:
1123 QOpenGLFunctions_4_5_CoreBackend(QOpenGLContext *c)
1124 : QOpenGLVersionFunctionsBackend(c)
1125 {
1126 init();
1127 }
1128
1129 Q_DECL_CONSTEXPR static Version versionStatus()
1130 { return OpenGL_4_5_Core; }
1131
1132 // OpenGL 4.5 core functions
1133#define QT_OPENGL_4_5_FUNCTIONS(F) \
1134 F(void, TextureBarrier, ()) \
1135 F(void, ReadnPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)) \
1136 F(void, GetnUniformuiv, (GLuint program, GLint location, GLsizei bufSize, GLuint *params)) \
1137 F(void, GetnUniformiv, (GLuint program, GLint location, GLsizei bufSize, GLint *params)) \
1138 F(void, GetnUniformfv, (GLuint program, GLint location, GLsizei bufSize, GLfloat *params)) \
1139 F(void, GetnUniformdv, (GLuint program, GLint location, GLsizei bufSize, GLdouble *params)) \
1140 F(void, GetnTexImage, (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels)) \
1141 F(void, GetnCompressedTexImage, (GLenum target, GLint lod, GLsizei bufSize, void *pixels)) \
1142 F(GLenum, GetGraphicsResetStatus, ()) \
1143 F(void, GetCompressedTextureSubImage, (GLuint texture,