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