1// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOPENGLTEXTUREHELPER_P_H
5#define QOPENGLTEXTUREHELPER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtOpenGL/qtopenglglobal.h>
19#include <QtCore/private/qglobal_p.h>
20
21#ifndef QT_NO_OPENGL
22
23#include "qopengl.h"
24#include "qopenglpixeltransferoptions.h"
25#include "qopengltexture.h"
26#include "qopenglfunctions.h"
27
28QT_BEGIN_NAMESPACE
29
30// Constants for OpenGL and OpenGL ES 3.0+ which are not available with OpenGL ES 2.0.
31#ifndef GL_TEXTURE_BASE_LEVEL
32#define GL_TEXTURE_BASE_LEVEL 0x813C
33#endif
34#ifndef GL_TEXTURE_MAX_LEVEL
35#define GL_TEXTURE_MAX_LEVEL 0x813D
36#endif
37#ifndef GL_TEXTURE_COMPARE_MODE
38#define GL_TEXTURE_COMPARE_MODE 0x884C
39#endif
40#ifndef GL_TEXTURE_COMPARE_FUNC
41#define GL_TEXTURE_COMPARE_FUNC 0x884D
42#endif
43
44// use GL_APICALL only on Android + __clang__
45#if !defined(Q_OS_ANDROID) || !defined(__clang__)
46# undef GL_APICALL
47# define GL_APICALL
48#elif !defined(GL_APICALL)
49# define GL_APICALL
50#endif
51
52class QOpenGLContext;
53
54class QOpenGLTextureHelper
55{
56public:
57 QOpenGLTextureHelper(QOpenGLContext *context);
58
59 // DSA-like API. Will either use real DSA or our emulation
60 inline void glTextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param)
61 {
62 (this->*TextureParameteri)(texture, target, bindingTarget, pname, param);
63 }
64
65 inline void glTextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params)
66 {
67 (this->*TextureParameteriv)(texture, target, bindingTarget, pname, params);
68 }
69
70 inline void glTextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param)
71 {
72 (this->*TextureParameterf)(texture, target, bindingTarget, pname, param);
73 }
74
75 inline void glTextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params)
76 {
77 (this->*TextureParameterfv)(texture, target, bindingTarget, pname, params);
78 }
79
80 inline void glGenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget)
81 {
82 (this->*GenerateTextureMipmap)(texture, target, bindingTarget);
83 }
84
85 inline void glTextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
86 GLsizei width, GLsizei height, GLsizei depth)
87 {
88 (this->*TextureStorage3D)(texture, target, bindingTarget, levels, internalFormat, width, height, depth);
89 }
90
91 inline void glTextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
92 GLsizei width, GLsizei height)
93 {
94 (this->*TextureStorage2D)(texture, target, bindingTarget, levels, internalFormat, width, height);
95 }
96
97 inline void glTextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
98 GLsizei width)
99 {
100 (this->*TextureStorage1D)(texture, target, bindingTarget, levels, internalFormat, width);
101 }
102
103 inline void glTextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat,
104 GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
105 {
106 (this->*TextureStorage3DMultisample)(texture, target, bindingTarget, samples, internalFormat, width, height, depth, fixedSampleLocations);
107 }
108
109 inline void glTextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat,
110 GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
111 {
112 (this->*TextureStorage2DMultisample)(texture, target, bindingTarget, samples, internalFormat, width, height, fixedSampleLocations);
113 }
114
115 inline void glTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
116 GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
117 {
118 (this->*TextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, format, type, pixels);
119 }
120
121 inline void glTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
122 GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
123 {
124 (this->*TextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, format, type, pixels);
125 }
126
127 inline void glTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
128 GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
129 {
130 (this->*TextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, format, type, pixels);
131 }
132
133 inline void glTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
134 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
135 const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
136 {
137 if (options) {
138 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
139 setPixelUploadOptions(*options);
140 (this->*TextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
141 setPixelUploadOptions(oldOptions);
142 } else {
143 (this->*TextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
144 }
145 }
146
147 inline void glTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset,
148 GLsizei width, GLsizei height, GLenum format, GLenum type,
149 const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
150 {
151 if (options) {
152 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
153 setPixelUploadOptions(*options);
154 (this->*TextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, type, pixels);
155 setPixelUploadOptions(oldOptions);
156 } else {
157 (this->*TextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, type, pixels);
158 }
159 }
160
161 inline void glTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset,
162 GLsizei width, GLenum format, GLenum type,
163 const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
164 {
165 if (options) {
166 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
167 setPixelUploadOptions(*options);
168 (this->*TextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, type, pixels);
169 setPixelUploadOptions(oldOptions);
170 } else {
171 (this->*TextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, type, pixels);
172 }
173 }
174
175 inline void glTextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat,
176 GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
177 {
178 (this->*TextureImage3DMultisample)(texture, target, bindingTarget, samples, internalFormat, width, height, depth, fixedSampleLocations);
179 }
180
181 inline void glTextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat,
182 GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
183 {
184 (this->*TextureImage2DMultisample)(texture, target, bindingTarget, samples, internalFormat, width, height, fixedSampleLocations);
185 }
186
187 inline void glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
188 GLint xoffset, GLsizei width,
189 GLenum format, GLsizei imageSize, const GLvoid *bits,
190 const QOpenGLPixelTransferOptions * const options = nullptr)
191 {
192 if (options) {
193 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
194 setPixelUploadOptions(*options);
195 (this->*CompressedTextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, imageSize, bits);
196 setPixelUploadOptions(oldOptions);
197 } else {
198 (this->*CompressedTextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, imageSize, bits);
199 }
200 }
201
202 inline void glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
203 GLint xoffset, GLint yoffset,
204 GLsizei width, GLsizei height,
205 GLenum format, GLsizei imageSize, const GLvoid *bits,
206 const QOpenGLPixelTransferOptions * const options = nullptr)
207 {
208 if (options) {
209 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
210 setPixelUploadOptions(*options);
211 (this->*CompressedTextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, imageSize, bits);
212 setPixelUploadOptions(oldOptions);
213 } else {
214 (this->*CompressedTextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, imageSize, bits);
215 }
216 }
217
218 inline void glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
219 GLint xoffset, GLint yoffset, GLint zoffset,
220 GLsizei width, GLsizei height, GLsizei depth,
221 GLenum format, GLsizei imageSize, const GLvoid *bits,
222 const QOpenGLPixelTransferOptions * const options = nullptr)
223 {
224 if (options) {
225 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
226 setPixelUploadOptions(*options);
227 (this->*CompressedTextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
228 setPixelUploadOptions(oldOptions);
229 } else {
230 (this->*CompressedTextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
231 }
232 }
233
234 inline void glCompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
235 GLenum internalFormat, GLsizei width,
236 GLint border, GLsizei imageSize, const GLvoid *bits,
237 const QOpenGLPixelTransferOptions * const options = nullptr)
238 {
239 if (options) {
240 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
241 setPixelUploadOptions(*options);
242 (this->*CompressedTextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, imageSize, bits);
243 setPixelUploadOptions(oldOptions);
244 } else {
245 (this->*CompressedTextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, imageSize, bits);
246 }
247 }
248
249 inline void glCompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
250 GLenum internalFormat, GLsizei width, GLsizei height,
251 GLint border, GLsizei imageSize, const GLvoid *bits,
252 const QOpenGLPixelTransferOptions * const options = nullptr)
253
254 {
255 if (options) {
256 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
257 setPixelUploadOptions(*options);
258 (this->*CompressedTextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, imageSize, bits);
259 setPixelUploadOptions(oldOptions);
260 } else {
261 (this->*CompressedTextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, imageSize, bits);
262 }
263 }
264
265 inline void glCompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
266 GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth,
267 GLint border, GLsizei imageSize, const GLvoid *bits,
268 const QOpenGLPixelTransferOptions * const options = nullptr)
269 {
270 if (options) {
271 QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
272 setPixelUploadOptions(*options);
273 (this->*CompressedTextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, imageSize, bits);
274 setPixelUploadOptions(oldOptions);
275 } else {
276 (this->*CompressedTextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, imageSize, bits);
277 }
278 }
279
280private:
281 // DSA wrapper (so we can use pointer to member function as switch)
282 void dsa_TextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param);
283
284 void dsa_TextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params);
285
286 void dsa_TextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param);
287
288 void dsa_TextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params);
289
290 void dsa_GenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget);
291
292 void dsa_TextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
293 GLsizei width, GLsizei height, GLsizei depth);
294
295 void dsa_TextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
296 GLsizei width, GLsizei height);
297
298 void dsa_TextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
299 GLsizei width);
300
301 void dsa_TextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat,
302 GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
303
304 void dsa_TextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat,
305 GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
306
307 void dsa_TextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
308 GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
309
310 void dsa_TextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
311 GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
312
313 void dsa_TextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
314 GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
315
316 void dsa_TextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
317 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
318
319 void dsa_TextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset,
320 GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
321
322 void dsa_TextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset,
323 GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
324
325 void dsa_TextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat,
326 GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
327
328 void dsa_TextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat,
329 GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
330
331 void dsa_CompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
332 GLint xoffset, GLsizei width,
333 GLenum format, GLsizei imageSize, const GLvoid *bits);
334
335 void dsa_CompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
336 GLint xoffset, GLint yoffset,
337 GLsizei width, GLsizei height,
338 GLenum format, GLsizei imageSize, const GLvoid *bits);
339
340 void dsa_CompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
341 GLint xoffset, GLint yoffset, GLint zoffset,
342 GLsizei width, GLsizei height, GLsizei depth,
343 GLenum format, GLsizei imageSize, const GLvoid *bits);
344
345 void dsa_CompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
346 GLenum internalFormat, GLsizei width,
347 GLint border, GLsizei imageSize, const GLvoid *bits);
348
349 void dsa_CompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
350 GLenum internalFormat, GLsizei width, GLsizei height,
351 GLint border, GLsizei imageSize, const GLvoid *bits);
352
353 void dsa_CompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
354 GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth,
355 GLint border, GLsizei imageSize, const GLvoid *bits);
356
357 // DSA emulation API
358 void qt_TextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param);
359
360 void qt_TextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params);
361
362 void qt_TextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param);
363
364 void qt_TextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params);
365
366 void qt_GenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget);
367
368 void qt_TextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels,
369 GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth);
370
371 void qt_TextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels,
372 GLenum internalFormat, GLsizei width, GLsizei height);
373
374 void qt_TextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels,
375 GLenum internalFormat, GLsizei width);
376
377 void qt_TextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
378 GLenum internalFormat, GLsizei width, GLsizei height,
379 GLsizei depth, GLboolean fixedSampleLocations);
380
381 void qt_TextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
382 GLenum internalFormat, GLsizei width, GLsizei height,
383 GLboolean fixedSampleLocations);
384
385 void qt_TextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
386 GLsizei width, GLsizei height, GLsizei depth,
387 GLint border, GLenum format, GLenum type,
388 const GLvoid *pixels);
389
390 void qt_TextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
391 GLsizei width, GLsizei height,
392 GLint border, GLenum format, GLenum type,
393 const GLvoid *pixels);
394
395 void qt_TextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
396 GLsizei width, GLint border, GLenum format, GLenum type,
397 const GLvoid *pixels);
398
399 void qt_TextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
400 GLint xoffset, GLint yoffset, GLint zoffset,
401 GLsizei width, GLsizei height, GLsizei depth,
402 GLenum format, GLenum type, const GLvoid *pixels);
403
404 void qt_TextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
405 GLint xoffset, GLint yoffset,
406 GLsizei width, GLsizei height,
407 GLenum format, GLenum type, const GLvoid *pixels);
408
409 void qt_TextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
410 GLint xoffset, GLsizei width,
411 GLenum format, GLenum type, const GLvoid *pixels);
412
413 void qt_TextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
414 GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth,
415 GLboolean fixedSampleLocations);
416
417 void qt_TextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
418 GLint internalFormat, GLsizei width, GLsizei height,
419 GLboolean fixedSampleLocations);
420
421 void qt_CompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
422 GLint xoffset, GLsizei width, GLenum format,
423 GLsizei imageSize, const GLvoid *bits);
424
425 void qt_CompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
426 GLint xoffset, GLint yoffset,
427 GLsizei width, GLsizei height,
428 GLenum format, GLsizei imageSize, const GLvoid *bits);
429
430 void qt_CompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
431 GLint xoffset, GLint yoffset, GLint zoffset,
432 GLsizei width, GLsizei height, GLsizei depth,
433 GLenum format, GLsizei imageSize, const GLvoid *bits);
434
435 void qt_CompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
436 GLsizei width, GLint border,
437 GLsizei imageSize, const GLvoid *bits);
438
439 void qt_CompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
440 GLsizei width, GLsizei height, GLint border,
441 GLsizei imageSize, const GLvoid *bits);
442
443 void qt_CompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
444 GLsizei width, GLsizei height, GLsizei depth, GLint border,
445 GLsizei imageSize, const GLvoid *bits);
446
447public:
448 // Raw OpenGL functions, resolved and used by our DSA-like static functions if no EXT_direct_state_access is available
449
450 // OpenGL 1.0
451 inline void glTexImage1D(GLenum target, GLint level, GLint internalFormat,
452 GLsizei width, GLint border,
453 GLenum format, GLenum type, const GLvoid *pixels)
454 {
455 TexImage1D(target, level, internalFormat, width, border, format, type, pixels);
456 }
457
458 // OpenGL 1.1
459 inline void glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width,
460 GLenum format, GLenum type, const GLvoid *pixels)
461 {
462 TexSubImage1D(target, level, xoffset, width, format, type, pixels);
463 }
464
465 // OpenGL 1.2
466 inline void glTexImage3D(GLenum target, GLint level, GLint internalFormat,
467 GLsizei width, GLsizei height, GLsizei depth, GLint border,
468 GLenum format, GLenum type, const GLvoid *pixels)
469 {
470 TexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels);
471 }
472
473 inline void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
474 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
475 {
476 TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
477 }
478
479 // OpenGL 1.3
480 inline void glGetCompressedTexImage(GLenum target, GLint level, GLvoid *img)
481 {
482 GetCompressedTexImage(target, level, img);
483 }
484
485 inline void glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width,
486 GLenum format, GLsizei imageSize, const GLvoid *data)
487 {
488 CompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data);
489 }
490
491 inline void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
492 GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
493 {
494 CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
495 }
496
497 inline void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
498 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
499 {
500 CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
501 }
502
503 inline void glCompressedTexImage1D(GLenum target, GLint level, GLenum internalFormat, GLsizei width,
504 GLint border, GLsizei imageSize, const GLvoid *data)
505 {
506 CompressedTexImage1D(target, level, internalFormat, width, border, imageSize, data);
507 }
508
509 inline void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height,
510 GLint border, GLsizei imageSize, const GLvoid *data)
511 {
512 CompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, data);
513 }
514
515 inline void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalFormat,
516 GLsizei width, GLsizei height, GLsizei depth,
517 GLint border, GLsizei imageSize, const GLvoid *data)
518 {
519 CompressedTexImage3D(target, level, internalFormat, width, height, depth, border, imageSize, data);
520 }
521
522 inline void glActiveTexture(GLenum texture)
523 {
524 ActiveTexture(texture);
525 }
526
527 // OpenGL 3.0
528 inline void glGenerateMipmap(GLenum target)
529 {
530 GenerateMipmap(target);
531 }
532
533 // OpenGL 3.2
534 inline void glTexImage3DMultisample(GLenum target, GLsizei samples, GLint internalFormat,
535 GLsizei width, GLsizei height, GLsizei depth,
536 GLboolean fixedSampleLocations)
537 {
538 TexImage3DMultisample(target, samples, internalFormat, width, height, depth, fixedSampleLocations);
539 }
540
541 inline void glTexImage2DMultisample(GLenum target, GLsizei samples, GLint internalFormat,
542 GLsizei width, GLsizei height,
543 GLboolean fixedSampleLocations)
544 {
545 TexImage2DMultisample(target, samples, internalFormat, width, height, fixedSampleLocations);
546 }
547
548 // OpenGL 4.2
549 inline void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
550 {
551 TexStorage3D(target, levels, internalFormat, width, height, depth);
552 }
553
554 inline void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
555 {
556 TexStorage2D(target, levels, internalFormat, width, height);
557 }
558
559 inline void glTexStorage1D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width)
560 {
561 TexStorage1D(target, levels, internalFormat, width);
562 }
563
564 // OpenGL 4.3
565 inline void glTexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalFormat,
566 GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
567 {
568 TexStorage3DMultisample(target, samples, internalFormat, width, height, depth, fixedSampleLocations);
569 }
570
571 inline void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalFormat,
572 GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
573 {
574 TexStorage2DMultisample(target, samples, internalFormat, width, height, fixedSampleLocations);
575 }
576
577 inline void glTexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer,
578 GLintptr offset, GLsizeiptr size)
579 {
580 TexBufferRange(target, internalFormat, buffer, offset, size);
581 }
582
583 inline void glTextureView(GLuint texture, GLenum target, GLuint origTexture, GLenum internalFormat,
584 GLuint minLevel, GLuint numLevels, GLuint minLayer, GLuint numLayers)
585 {
586 TextureView(texture, target, origTexture, internalFormat, minLevel, numLevels, minLayer, numLayers);
587 }
588
589 // Helper functions
590 inline QOpenGLPixelTransferOptions savePixelUploadOptions()
591 {
592 QOpenGLPixelTransferOptions options;
593 int val = 0;
594 functions->glGetIntegerv(GL_UNPACK_ALIGNMENT, params: &val);
595 options.setAlignment(val);
596#if !QT_CONFIG(opengles2)
597 functions->glGetIntegerv(GL_UNPACK_SKIP_IMAGES, params: &val);
598 options.setSkipImages(val);
599 functions->glGetIntegerv(GL_UNPACK_SKIP_ROWS, params: &val);
600 options.setSkipRows(val);
601 functions->glGetIntegerv(GL_UNPACK_SKIP_PIXELS, params: &val);
602 options.setSkipPixels(val);
603 functions->glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, params: &val);
604 options.setImageHeight(val);
605 functions->glGetIntegerv(GL_UNPACK_ROW_LENGTH, params: &val);
606 options.setRowLength(val);
607 GLboolean b = GL_FALSE;
608 functions->glGetBooleanv(GL_UNPACK_LSB_FIRST, params: &b);
609 options.setLeastSignificantByteFirst(b);
610 functions->glGetBooleanv(GL_UNPACK_SWAP_BYTES, params: &b);
611 options.setSwapBytesEnabled(b);
612#endif
613 return options;
614 }
615
616 inline void setPixelUploadOptions(const QOpenGLPixelTransferOptions &options)
617 {
618 functions->glPixelStorei(GL_UNPACK_ALIGNMENT, param: options.alignment());
619#if !QT_CONFIG(opengles2)
620 functions->glPixelStorei(GL_UNPACK_SKIP_IMAGES, param: options.skipImages());
621 functions->glPixelStorei(GL_UNPACK_SKIP_ROWS, param: options.skipRows());
622 functions->glPixelStorei(GL_UNPACK_SKIP_PIXELS, param: options.skipPixels());
623 functions->glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, param: options.imageHeight());
624 functions->glPixelStorei(GL_UNPACK_ROW_LENGTH, param: options.rowLength());
625 functions->glPixelStorei(GL_UNPACK_LSB_FIRST, param: options.isLeastSignificantBitFirst());
626 functions->glPixelStorei(GL_UNPACK_SWAP_BYTES, param: options.isSwapBytesEnabled());
627#endif
628 }
629
630 QOpenGLFunctions *functions;
631private:
632 // Typedefs and pointers to member functions used to switch between EXT_direct_state_access and our own emulated DSA.
633 // The argument match the corresponding GL function, but there's an extra "GLenum bindingTarget" which gets used with
634 // the DSA emulation -- it contains the right GL_BINDING_TEXTURE_X to use.
635 typedef void (QOpenGLTextureHelper::*TextureParameteriMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param);
636 typedef void (QOpenGLTextureHelper::*TextureParameterivMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params);
637 typedef void (QOpenGLTextureHelper::*TextureParameterfMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param);
638 typedef void (QOpenGLTextureHelper::*TextureParameterfvMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params);
639 typedef void (QOpenGLTextureHelper::*GenerateTextureMipmapMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget);
640 typedef void (QOpenGLTextureHelper::*TextureStorage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth);
641 typedef void (QOpenGLTextureHelper::*TextureStorage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height);
642 typedef void (QOpenGLTextureHelper::*TextureStorage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width);
643 typedef void (QOpenGLTextureHelper::*TextureStorage3DMultisampleMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
644 typedef void (QOpenGLTextureHelper::*TextureStorage2DMultisampleMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
645 typedef void (QOpenGLTextureHelper::*TextureImage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
646 typedef void (QOpenGLTextureHelper::*TextureImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
647 typedef void (QOpenGLTextureHelper::*TextureImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
648 typedef void (QOpenGLTextureHelper::*TextureSubImage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
649 typedef void (QOpenGLTextureHelper::*TextureSubImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
650 typedef void (QOpenGLTextureHelper::*TextureSubImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
651 typedef void (QOpenGLTextureHelper::*TextureImage3DMultisampleMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
652 typedef void (QOpenGLTextureHelper::*TextureImage2DMultisampleMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
653 typedef void (QOpenGLTextureHelper::*CompressedTextureSubImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
654 typedef void (QOpenGLTextureHelper::*CompressedTextureSubImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
655 typedef void (QOpenGLTextureHelper::*CompressedTextureSubImage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
656 typedef void (QOpenGLTextureHelper::*CompressedTextureImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
657 typedef void (QOpenGLTextureHelper::*CompressedTextureImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
658 typedef void (QOpenGLTextureHelper::*CompressedTextureImage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
659
660
661 TextureParameteriMemberFunc TextureParameteri;
662 TextureParameterivMemberFunc TextureParameteriv;
663 TextureParameterfMemberFunc TextureParameterf;
664 TextureParameterfvMemberFunc TextureParameterfv;
665 GenerateTextureMipmapMemberFunc GenerateTextureMipmap;
666 TextureStorage3DMemberFunc TextureStorage3D;
667 TextureStorage2DMemberFunc TextureStorage2D;
668 TextureStorage1DMemberFunc TextureStorage1D;
669 TextureStorage3DMultisampleMemberFunc TextureStorage3DMultisample;
670 TextureStorage2DMultisampleMemberFunc TextureStorage2DMultisample;
671 TextureImage3DMemberFunc TextureImage3D;
672 TextureImage2DMemberFunc TextureImage2D;
673 TextureImage1DMemberFunc TextureImage1D;
674 TextureSubImage3DMemberFunc TextureSubImage3D;
675 TextureSubImage2DMemberFunc TextureSubImage2D;
676 TextureSubImage1DMemberFunc TextureSubImage1D;
677 TextureImage3DMultisampleMemberFunc TextureImage3DMultisample;
678 TextureImage2DMultisampleMemberFunc TextureImage2DMultisample;
679 CompressedTextureSubImage1DMemberFunc CompressedTextureSubImage1D;
680 CompressedTextureSubImage2DMemberFunc CompressedTextureSubImage2D;
681 CompressedTextureSubImage3DMemberFunc CompressedTextureSubImage3D;
682 CompressedTextureImage1DMemberFunc CompressedTextureImage1D;
683 CompressedTextureImage2DMemberFunc CompressedTextureImage2D;
684 CompressedTextureImage3DMemberFunc CompressedTextureImage3D;
685
686 // Raw function pointers for core and DSA functions
687
688 // EXT_direct_state_access used when DSA is available
689 void (QOPENGLF_APIENTRYP TextureParameteriEXT)(GLuint texture, GLenum target, GLenum pname, GLint param);
690 void (QOPENGLF_APIENTRYP TextureParameterivEXT)(GLuint texture, GLenum target, GLenum pname, const GLint *params);
691 void (QOPENGLF_APIENTRYP TextureParameterfEXT)(GLuint texture, GLenum target, GLenum pname, GLfloat param);
692 void (QOPENGLF_APIENTRYP TextureParameterfvEXT)(GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
693 void (QOPENGLF_APIENTRYP GenerateTextureMipmapEXT)(GLuint texture, GLenum target);
694 void (QOPENGLF_APIENTRYP TextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth);
695 void (QOPENGLF_APIENTRYP TextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height);
696 void (QOPENGLF_APIENTRYP TextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width);
697 void (QOPENGLF_APIENTRYP TextureStorage3DMultisampleEXT)(GLuint texture, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
698 void (QOPENGLF_APIENTRYP TextureStorage2DMultisampleEXT)(GLuint texture, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
699 void (QOPENGLF_APIENTRYP TextureImage3DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
700 void (QOPENGLF_APIENTRYP TextureImage2DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
701 void (QOPENGLF_APIENTRYP TextureImage1DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
702 void (QOPENGLF_APIENTRYP TextureSubImage3DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
703 void (QOPENGLF_APIENTRYP TextureSubImage2DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
704 void (QOPENGLF_APIENTRYP TextureSubImage1DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
705 void (QOPENGLF_APIENTRYP CompressedTextureSubImage1DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
706 void (QOPENGLF_APIENTRYP CompressedTextureSubImage2DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
707 void (QOPENGLF_APIENTRYP CompressedTextureSubImage3DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
708 void (QOPENGLF_APIENTRYP CompressedTextureImage1DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
709 void (QOPENGLF_APIENTRYP CompressedTextureImage2DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
710 void (QOPENGLF_APIENTRYP CompressedTextureImage3DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
711
712
713 // Plus some missing ones that are in the NV_texture_multisample extension instead
714 void (QOPENGLF_APIENTRYP TextureImage3DMultisampleNV)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
715 void (QOPENGLF_APIENTRYP TextureImage2DMultisampleNV)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
716
717 // OpenGL 1.0
718 void (QOPENGLF_APIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
719
720 // OpenGL 1.1
721 void (QOPENGLF_APIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
722
723 // OpenGL 1.2
724 void (QOPENGLF_APIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
725 void (QOPENGLF_APIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
726
727 // OpenGL 1.3
728 void (QOPENGLF_APIENTRYP GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img);
729 void (QOPENGLF_APIENTRYP CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
730 GL_APICALL void (QOPENGLF_APIENTRYP CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
731 void (QOPENGLF_APIENTRYP CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
732 void (QOPENGLF_APIENTRYP CompressedTexImage1D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
733 GL_APICALL void (QOPENGLF_APIENTRYP CompressedTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
734 void (QOPENGLF_APIENTRYP CompressedTexImage3D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
735 GL_APICALL void (QOPENGLF_APIENTRYP ActiveTexture)(GLenum texture);
736
737 // OpenGL 3.0
738 GL_APICALL void (QOPENGLF_APIENTRYP GenerateMipmap)(GLenum target);
739
740 // OpenGL 3.2
741 void (QOPENGLF_APIENTRYP TexImage3DMultisample)(GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
742 void (QOPENGLF_APIENTRYP TexImage2DMultisample)(GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
743
744 // OpenGL 4.2
745 void (QOPENGLF_APIENTRYP TexStorage3D)(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth);
746 void (QOPENGLF_APIENTRYP TexStorage2D)(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height);
747 void (QOPENGLF_APIENTRYP TexStorage1D)(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width);
748
749 // OpenGL 4.3
750 void (QOPENGLF_APIENTRYP TexStorage3DMultisample)(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
751 void (QOPENGLF_APIENTRYP TexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
752 void (QOPENGLF_APIENTRYP TexBufferRange)(GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size);
753 void (QOPENGLF_APIENTRYP TextureView)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
754};
755
756QT_END_NAMESPACE
757
758#undef Q_CALL_MEMBER_FUNCTION
759
760#endif // QT_NO_OPENGL
761
762#endif // QOPENGLTEXTUREHELPER_P_H
763

source code of qtbase/src/opengl/qopengltexturehelper_p.h