| 1 |
// Copyright (C) 2021 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 |
|
| 4 |
#include "qeglplatformcontext_p.h" |
| 5 |
#include "qeglconvenience_p.h" |
| 6 |
#include "qeglpbuffer_p.h" |
| 7 |
#include <qpa/qplatformwindow.h> |
| 8 |
#include <QtGui/qopengl.h> |
| 9 |
#include <QtGui/qopenglcontext.h> |
| 10 |
#include <QtCore/qdebug.h> |
| 11 |
|
| 12 |
#ifdef Q_OS_ANDROID |
| 13 |
#include <QtCore/private/qjnihelpers_p.h> |
| 14 |
#endif |
| 15 |
#ifndef Q_OS_WIN |
| 16 |
#include <dlfcn.h> |
| 17 |
#endif |
| 18 |
|
| 19 |
QT_BEGIN_NAMESPACE |
| 20 |
|
| 21 |
/*! |
| 22 |
\class QEGLPlatformContext |
| 23 |
\brief An EGL context implementation. |
| 24 |
\since 5.2 |
| 25 |
\internal |
| 26 |
\ingroup qpa |
| 27 |
|
| 28 |
Implement QPlatformOpenGLContext using EGL. To use it in platform |
| 29 |
plugins a subclass must be created since |
| 30 |
eglSurfaceForPlatformSurface() has to be reimplemented. This |
| 31 |
function is used for mapping platform surfaces (windows) to EGL |
| 32 |
surfaces and is necessary since different platform plugins may |
| 33 |
have different ways of handling native windows (for example, a |
| 34 |
plugin may choose not to back every platform window by a real EGL |
| 35 |
surface). Other than that, no further customization is necessary. |
| 36 |
*/ |
| 37 |
|
| 38 |
// Constants from EGL_KHR_create_context |
| 39 |
#ifndef EGL_CONTEXT_MINOR_VERSION_KHR |
| 40 |
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB |
| 41 |
#endif |
| 42 |
#ifndef EGL_CONTEXT_FLAGS_KHR |
| 43 |
#define EGL_CONTEXT_FLAGS_KHR 0x30FC |
| 44 |
#endif |
| 45 |
#ifndef EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR |
| 46 |
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD |
| 47 |
#endif |
| 48 |
#ifndef EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR |
| 49 |
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 |
| 50 |
#endif |
| 51 |
#ifndef EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR |
| 52 |
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 |
| 53 |
#endif |
| 54 |
#ifndef EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR |
| 55 |
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 |
| 56 |
#endif |
| 57 |
#ifndef EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR |
| 58 |
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 |
| 59 |
#endif |
| 60 |
#ifndef EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR |
| 61 |
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD |
| 62 |
#endif |
| 63 |
#ifndef EGL_LOSE_CONTEXT_ON_RESET_KHR |
| 64 |
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF |
| 65 |
#endif |
| 66 |
#ifndef EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR |
| 67 |
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 |
| 68 |
#endif |
| 69 |
|
| 70 |
// Constants from EGL_EXT_create_context_robustness |
| 71 |
#ifndef EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT |
| 72 |
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF |
| 73 |
#endif |
| 74 |
#ifndef EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT |
| 75 |
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 |
| 76 |
#endif |
| 77 |
#ifndef EGL_LOSE_CONTEXT_ON_RESET_EXT |
| 78 |
#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF |
| 79 |
#endif |
| 80 |
|
| 81 |
// Constants for OpenGL which are not available in the ES headers. |
| 82 |
#ifndef GL_CONTEXT_FLAGS |
| 83 |
#define GL_CONTEXT_FLAGS 0x821E |
| 84 |
#endif |
| 85 |
#ifndef GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT |
| 86 |
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 |
| 87 |
#endif |
| 88 |
#ifndef GL_CONTEXT_FLAG_DEBUG_BIT |
| 89 |
#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 |
| 90 |
#endif |
| 91 |
#ifndef GL_CONTEXT_PROFILE_MASK |
| 92 |
#define GL_CONTEXT_PROFILE_MASK 0x9126 |
| 93 |
#endif |
| 94 |
#ifndef GL_CONTEXT_CORE_PROFILE_BIT |
| 95 |
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 |
| 96 |
#endif |
| 97 |
#ifndef GL_CONTEXT_COMPATIBILITY_PROFILE_BIT |
| 98 |
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 |
| 99 |
#endif |
| 100 |
#ifndef GL_RESET_NOTIFICATION_STRATEGY |
| 101 |
#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 |
| 102 |
#endif |
| 103 |
#ifndef GL_LOSE_CONTEXT_ON_RESET |
| 104 |
#define GL_LOSE_CONTEXT_ON_RESET 0x8252 |
| 105 |
#endif |
| 106 |
|
| 107 |
// Constants from GL_EXT_robustness. |
| 108 |
#ifndef GL_RESET_NOTIFICATION_STRATEGY_EXT |
| 109 |
#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 |
| 110 |
#endif |
| 111 |
#ifndef GL_LOSE_CONTEXT_ON_RESET_EXT |
| 112 |
#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 |
| 113 |
#endif |
| 114 |
|
| 115 |
// Constants from EGL_NV_robustness_video_memory_purge |
| 116 |
#ifndef EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV |
| 117 |
#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C |
| 118 |
#endif |
| 119 |
|
| 120 |
QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, |
| 121 |
EGLConfig *config, Flags flags) |
| 122 |
: m_eglDisplay(display) |
| 123 |
, m_flags(flags) |
| 124 |
, m_ownsContext(true) |
| 125 |
{ |
| 126 |
m_eglConfig = config ? *config : q_configFromGLFormat(display, format); |
| 127 |
|
| 128 |
m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig, format); |
| 129 |
// m_format now has the renderableType() resolved (it cannot be Default anymore) |
| 130 |
// but does not yet contain version, profile, options. |
| 131 |
m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : nullptr; |
| 132 |
|
| 133 |
switch (m_format.renderableType()) { |
| 134 |
case QSurfaceFormat::OpenVG: |
| 135 |
m_api = EGL_OPENVG_API; |
| 136 |
break; |
| 137 |
#ifdef EGL_VERSION_1_4 |
| 138 |
case QSurfaceFormat::OpenGL: |
| 139 |
m_api = EGL_OPENGL_API; |
| 140 |
break; |
| 141 |
#endif // EGL_VERSION_1_4 |
| 142 |
default: |
| 143 |
m_api = EGL_OPENGL_ES_API; |
| 144 |
break; |
| 145 |
} |
| 146 |
|
| 147 |
m_contextAttrs = buildContextAttributes(format); |
| 148 |
|
| 149 |
eglBindAPI(m_api); |
| 150 |
m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, m_shareContext, m_contextAttrs.constData()); |
| 151 |
|
| 152 |
if (m_eglContext == EGL_NO_CONTEXT && format.testOption(QSurfaceFormat::ResetNotification)) { |
| 153 |
QSurfaceFormat formatWithoutResetNotification = format; |
| 154 |
formatWithoutResetNotification.setOption(QSurfaceFormat::ResetNotification, false); |
| 155 |
m_contextAttrs = buildContextAttributes(formatWithoutResetNotification); |
| 156 |
m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, m_shareContext, m_contextAttrs.constData()); |
| 157 |
} |
| 158 |
if (m_eglContext == EGL_NO_CONTEXT && m_shareContext != EGL_NO_CONTEXT) { |
| 159 |
m_shareContext = nullptr; |
| 160 |
m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, nullptr, m_contextAttrs.constData()); |
| 161 |
} |
| 162 |
|
| 163 |
if (m_eglContext == EGL_NO_CONTEXT) { |
| 164 |
qWarning("QEGLPlatformContext: Failed to create context: %x", eglGetError()); |
| 165 |
return; |
| 166 |
} |
| 167 |
|
| 168 |
m_getGraphicsResetStatus = reinterpret_cast<GLenum (QOPENGLF_APIENTRYP)()>(getProcAddress("glGetGraphicsResetStatusARB")); |
| 169 |
|
| 170 |
static const bool printConfig = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEBUG"); |
| 171 |
if (printConfig) { |
| 172 |
qDebug() << "Created context for format" << format << "with config:"; |
| 173 |
q_printEglConfig(m_eglDisplay, m_eglConfig); |
| 174 |
|
| 175 |
static const bool printAllConfigs = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEBUG") > 1; |
| 176 |
if (printAllConfigs) { |
| 177 |
EGLint numConfigs = 0; |
| 178 |
eglGetConfigs(m_eglDisplay, nullptr, 0, &numConfigs); |
| 179 |
QVector<EGLConfig> configs; |
| 180 |
configs.resize(numConfigs); |
| 181 |
eglGetConfigs(m_eglDisplay, configs.data(), numConfigs, &numConfigs); |
| 182 |
qDebug("\nAll EGLConfigs: count=%d", numConfigs); |
| 183 |
for (EGLint i = 0; i < numConfigs; ++i) { |
| 184 |
qDebug("EGLConfig #%d", i); |
| 185 |
q_printEglConfig(m_eglDisplay, configs[i]); |
| 186 |
} |
| 187 |
qDebug("\n"); |
| 188 |
} |
| 189 |
} |
| 190 |
|
| 191 |
// Cannot just call updateFormatFromGL() since it relies on virtuals. Defer it to initialize(). |
| 192 |
} |
| 193 |
|
| 194 |
QList<EGLint> QEGLPlatformContext::buildContextAttributes(const QSurfaceFormat &format) |
| 195 |
{ |
| 196 |
QList<EGLint> contextAttrs; |
| 197 |
contextAttrs.append(EGL_CONTEXT_CLIENT_VERSION); |
| 198 |
contextAttrs.append(format.majorVersion()); |
| 199 |
const bool hasKHRCreateContext = q_hasEglExtension(m_eglDisplay, "EGL_KHR_create_context"); |
| 200 |
if (hasKHRCreateContext) { |
| 201 |
contextAttrs.append(EGL_CONTEXT_MINOR_VERSION_KHR); |
| 202 |
contextAttrs.append(format.minorVersion()); |
| 203 |
int flags = 0; |
| 204 |
// The debug bit is supported both for OpenGL and OpenGL ES. |
| 205 |
if (format.testOption(QSurfaceFormat::DebugContext)) |
| 206 |
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; |
| 207 |
// The fwdcompat bit is only for OpenGL 3.0+. |
| 208 |
if (m_format.renderableType() == QSurfaceFormat::OpenGL |
| 209 |
&& format.majorVersion() >= 3 |
| 210 |
&& !format.testOption(QSurfaceFormat::DeprecatedFunctions)) |
| 211 |
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR; |
| 212 |
|
| 213 |
// Profiles are OpenGL only and mandatory in 3.2+. The value is silently ignored for < 3.2. |
| 214 |
if (m_format.renderableType() == QSurfaceFormat::OpenGL) { |
| 215 |
contextAttrs.append(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR); |
| 216 |
contextAttrs.append(format.profile() == QSurfaceFormat::CoreProfile |
| 217 |
? EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR |
| 218 |
: EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR); |
| 219 |
} |
| 220 |
|
| 221 |
if (format.testOption(QSurfaceFormat::ResetNotification)) { |
| 222 |
const bool haveResetOnVideoMemoryPurge = q_hasEglExtension(m_eglDisplay, "EGL_NV_robustness_video_memory_purge"); |
| 223 |
|
| 224 |
if (m_format.renderableType() == QSurfaceFormat::OpenGL) { |
| 225 |
flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR; |
| 226 |
contextAttrs.append(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR); |
| 227 |
contextAttrs.append(EGL_LOSE_CONTEXT_ON_RESET_KHR); |
| 228 |
if (haveResetOnVideoMemoryPurge) { |
| 229 |
contextAttrs.append(EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV); |
| 230 |
contextAttrs.append(EGL_TRUE); |
| 231 |
} |
| 232 |
} else if (m_format.renderableType() == QSurfaceFormat::OpenGLES) { |
| 233 |
if (q_hasEglExtension(m_eglDisplay, "EGL_EXT_create_context_robustness")) { |
| 234 |
contextAttrs.append(EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT); |
| 235 |
contextAttrs.append(EGL_TRUE); |
| 236 |
contextAttrs.append(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT); |
| 237 |
contextAttrs.append(EGL_LOSE_CONTEXT_ON_RESET_EXT); |
| 238 |
if (haveResetOnVideoMemoryPurge) { |
| 239 |
contextAttrs.append(EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV); |
| 240 |
contextAttrs.append(EGL_TRUE); |
| 241 |
} |
| 242 |
} |
| 243 |
} |
| 244 |
} |
| 245 |
|
| 246 |
if (flags) { |
| 247 |
contextAttrs.append(EGL_CONTEXT_FLAGS_KHR); |
| 248 |
contextAttrs.append(flags); |
| 249 |
} |
| 250 |
} |
| 251 |
|
| 252 |
#ifdef EGL_EXT_protected_content |
| 253 |
if (format.testOption(QSurfaceFormat::ProtectedContent)) { |
| 254 |
if (q_hasEglExtension(m_eglDisplay, "EGL_EXT_protected_content")) { |
| 255 |
contextAttrs.append(EGL_PROTECTED_CONTENT_EXT); |
| 256 |
contextAttrs.append(EGL_TRUE); |
| 257 |
} else { |
| 258 |
m_format.setOption(QSurfaceFormat::ProtectedContent, false); |
| 259 |
} |
| 260 |
} |
| 261 |
#endif |
| 262 |
|
| 263 |
// Special Options for OpenVG surfaces |
| 264 |
if (m_format.renderableType() == QSurfaceFormat::OpenVG) { |
| 265 |
contextAttrs.append(EGL_ALPHA_MASK_SIZE); |
| 266 |
contextAttrs.append(8); |
| 267 |
} |
| 268 |
|
| 269 |
contextAttrs.append(EGL_NONE); |
| 270 |
return contextAttrs; |
| 271 |
} |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
void QEGLPlatformContext::adopt(EGLContext context, EGLDisplay display, QPlatformOpenGLContext *share) |
| 276 |
{ |
| 277 |
Q_ASSERT(!m_ownsContext); |
| 278 |
|
| 279 |
m_eglDisplay = display; |
| 280 |
|
| 281 |
// Figure out the EGLConfig. |
| 282 |
EGLint value = 0; |
| 283 |
eglQueryContext(m_eglDisplay, context, EGL_CONFIG_ID, &value); |
| 284 |
EGLint n = 0; |
| 285 |
EGLConfig cfg; |
| 286 |
const EGLint attribs[] = { EGL_CONFIG_ID, value, EGL_NONE }; |
| 287 |
if (eglChooseConfig(m_eglDisplay, attribs, &cfg, 1, &n) && n == 1) { |
| 288 |
m_eglConfig = cfg; |
| 289 |
m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig); |
| 290 |
} else { |
| 291 |
qWarning("QEGLPlatformContext: Failed to get framebuffer configuration for context"); |
| 292 |
} |
| 293 |
|
| 294 |
// Fetch client API type. |
| 295 |
value = 0; |
| 296 |
eglQueryContext(m_eglDisplay, context, EGL_CONTEXT_CLIENT_TYPE, &value); |
| 297 |
if (value == EGL_OPENGL_API || value == EGL_OPENGL_ES_API) { |
| 298 |
// if EGL config supports both OpenGL and OpenGL ES render type, |
| 299 |
// q_glFormatFromConfig() with the default "referenceFormat" parameter |
| 300 |
// will always figure it out as OpenGL render type. |
| 301 |
// We can override it to match user's real render type. |
| 302 |
if (value == EGL_OPENGL_ES_API) |
| 303 |
m_format.setRenderableType(QSurfaceFormat::OpenGLES); |
| 304 |
m_api = value; |
| 305 |
eglBindAPI(m_api); |
| 306 |
} else { |
| 307 |
qWarning("QEGLPlatformContext: Failed to get client API type"); |
| 308 |
m_api = EGL_OPENGL_ES_API; |
| 309 |
} |
| 310 |
|
| 311 |
m_eglContext = context; |
| 312 |
m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : nullptr; |
| 313 |
updateFormatFromGL(); |
| 314 |
} |
| 315 |
|
| 316 |
void QEGLPlatformContext::initialize() |
| 317 |
{ |
| 318 |
if (m_eglContext != EGL_NO_CONTEXT) |
| 319 |
updateFormatFromGL(); |
| 320 |
} |
| 321 |
|
| 322 |
// Base implementation for pbuffers. Subclasses will handle the specialized cases for |
| 323 |
// platforms without pbuffers. |
| 324 |
EGLSurface QEGLPlatformContext::createTemporaryOffscreenSurface() |
| 325 |
{ |
| 326 |
// Make the context current to ensure the GL version query works. This needs a surface too. |
| 327 |
const EGLint pbufferAttributes[] = { |
| 328 |
EGL_WIDTH, 1, |
| 329 |
EGL_HEIGHT, 1, |
| 330 |
EGL_LARGEST_PBUFFER, EGL_FALSE, |
| 331 |
EGL_NONE |
| 332 |
}; |
| 333 |
|
| 334 |
// Cannot just pass m_eglConfig because it may not be suitable for pbuffers. Instead, |
| 335 |
// do what QEGLPbuffer would do: request a config with the same attributes but with |
| 336 |
// PBUFFER_BIT set. |
| 337 |
EGLConfig config = q_configFromGLFormat(m_eglDisplay, m_format, false, EGL_PBUFFER_BIT); |
| 338 |
|
| 339 |
return eglCreatePbufferSurface(m_eglDisplay, config, pbufferAttributes); |
| 340 |
} |
| 341 |
|
| 342 |
void QEGLPlatformContext::destroyTemporaryOffscreenSurface(EGLSurface surface) |
| 343 |
{ |
| 344 |
eglDestroySurface(m_eglDisplay, surface); |
| 345 |
} |
| 346 |
|
| 347 |
void QEGLPlatformContext::runGLChecks() |
| 348 |
{ |
| 349 |
// Nothing to do here, subclasses may override in order to perform OpenGL |
| 350 |
// queries needing a context. |
| 351 |
} |
| 352 |
|
| 353 |
#ifndef QT_NO_OPENGL |
| 354 |
bool QEGLPlatformContext::hasExtension(const char *name) |
| 355 |
{ |
| 356 |
// glGetString(GL_EXTENSIONS) is deprecated in OpenGL 3. |
| 357 |
if (m_format.renderableType() == QSurfaceFormat::OpenGL && m_format.majorVersion() >= 3) { |
| 358 |
#ifdef QT_OPENGL_3 |
| 359 |
typedef const GLubyte *(QOPENGLF_APIENTRYP qt_glGetStringi)(GLenum, GLuint); |
| 360 |
const auto glGetStringi = reinterpret_cast<qt_glGetStringi>(getProcAddress("glGetStringi")); |
| 361 |
if (!glGetStringi) { |
| 362 |
return false; |
| 363 |
} |
| 364 |
|
| 365 |
int extensionCount = 0; |
| 366 |
glGetIntegerv(GL_NUM_EXTENSIONS, &extensionCount); |
| 367 |
|
| 368 |
for (int i = 0; i < extensionCount; ++i) { |
| 369 |
const char *extensionName = reinterpret_cast<const char *>(glGetStringi(GL_EXTENSIONS, i)); |
| 370 |
if (strcmp(extensionName, name) == 0) { |
| 371 |
return true; |
| 372 |
} |
| 373 |
} |
| 374 |
#endif |
| 375 |
|
| 376 |
return false; |
| 377 |
} |
| 378 |
|
| 379 |
const size_t extensionSize = strlen(name); |
| 380 |
const char *availableExtensions = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)); |
| 381 |
const char *availableExtensionsEnd = availableExtensions + strlen(availableExtensions); |
| 382 |
|
| 383 |
for (const char *cursor = availableExtensions; cursor < availableExtensionsEnd;) { |
| 384 |
if (*cursor == ' ') { |
| 385 |
cursor++; |
| 386 |
continue; |
| 387 |
} |
| 388 |
|
| 389 |
const size_t n = strcspn(cursor, " "); |
| 390 |
if (extensionSize == n && strncmp(name, cursor, n) == 0) { |
| 391 |
return true; |
| 392 |
} |
| 393 |
|
| 394 |
cursor += n; |
| 395 |
} |
| 396 |
|
| 397 |
return false; |
| 398 |
} |
| 399 |
#endif |
| 400 |
|
| 401 |
void QEGLPlatformContext::updateFormatFromGL() |
| 402 |
{ |
| 403 |
#ifndef QT_NO_OPENGL |
| 404 |
// Have to save & restore to prevent QOpenGLContext::currentContext() from becoming |
| 405 |
// inconsistent after QOpenGLContext::create(). |
| 406 |
EGLDisplay prevDisplay = eglGetCurrentDisplay(); |
| 407 |
if (prevDisplay == EGL_NO_DISPLAY) // when no context is current |
| 408 |
prevDisplay = m_eglDisplay; |
| 409 |
EGLContext prevContext = eglGetCurrentContext(); |
| 410 |
EGLSurface prevSurfaceDraw = eglGetCurrentSurface(EGL_DRAW); |
| 411 |
EGLSurface prevSurfaceRead = eglGetCurrentSurface(EGL_READ); |
| 412 |
|
| 413 |
// Rely on the surfaceless extension, if available. This is beneficial since we can |
| 414 |
// avoid creating an extra pbuffer surface which is apparently troublesome with some |
| 415 |
// drivers (Mesa) when certain attributes are present (multisampling). |
| 416 |
EGLSurface tempSurface = EGL_NO_SURFACE; |
| 417 |
EGLContext tempContext = EGL_NO_CONTEXT; |
| 418 |
if (m_flags.testFlag(NoSurfaceless) || !q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context")) |
| 419 |
tempSurface = createTemporaryOffscreenSurface(); |
| 420 |
|
| 421 |
EGLBoolean ok = eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, m_eglContext); |
| 422 |
if (!ok) { |
| 423 |
EGLConfig config = q_configFromGLFormat(m_eglDisplay, m_format, false, EGL_PBUFFER_BIT); |
| 424 |
tempContext = eglCreateContext(m_eglDisplay, config, nullptr, m_contextAttrs.constData()); |
| 425 |
if (tempContext != EGL_NO_CONTEXT) |
| 426 |
ok = eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, tempContext); |
| 427 |
} |
| 428 |
if (ok) { |
| 429 |
if (m_format.renderableType() == QSurfaceFormat::OpenGL |
| 430 |
|| m_format.renderableType() == QSurfaceFormat::OpenGLES) { |
| 431 |
const GLubyte *s = glGetString(GL_VERSION); |
| 432 |
if (s) { |
| 433 |
QByteArray version = QByteArray(reinterpret_cast<const char *>(s)); |
| 434 |
int major, minor; |
| 435 |
if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor)) { |
| 436 |
m_format.setMajorVersion(major); |
| 437 |
m_format.setMinorVersion(minor); |
| 438 |
} |
| 439 |
} |
| 440 |
m_format.setProfile(QSurfaceFormat::NoProfile); |
| 441 |
m_format.setOptions(QSurfaceFormat::FormatOptions()); |
| 442 |
if (m_format.renderableType() == QSurfaceFormat::OpenGL) { |
| 443 |
// Check profile and options. |
| 444 |
if (m_format.majorVersion() < 3) { |
| 445 |
m_format.setOption(QSurfaceFormat::DeprecatedFunctions); |
| 446 |
} else { |
| 447 |
GLint value = 0; |
| 448 |
glGetIntegerv(GL_CONTEXT_FLAGS, &value); |
| 449 |
if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)) |
| 450 |
m_format.setOption(QSurfaceFormat::DeprecatedFunctions); |
| 451 |
if (value & GL_CONTEXT_FLAG_DEBUG_BIT) |
| 452 |
m_format.setOption(QSurfaceFormat::DebugContext); |
| 453 |
if (m_format.version() >= std::pair(3, 2)) { |
| 454 |
value = 0; |
| 455 |
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value); |
| 456 |
if (value & GL_CONTEXT_CORE_PROFILE_BIT) |
| 457 |
m_format.setProfile(QSurfaceFormat::CoreProfile); |
| 458 |
else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) |
| 459 |
m_format.setProfile(QSurfaceFormat::CompatibilityProfile); |
| 460 |
} |
| 461 |
} |
| 462 |
} |
| 463 |
if (m_format.renderableType() == QSurfaceFormat::OpenGL && hasExtension("GL_ARB_robustness")) { |
| 464 |
GLint value = 0; |
| 465 |
glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY, &value); |
| 466 |
if (value == GL_LOSE_CONTEXT_ON_RESET) |
| 467 |
m_format.setOption(QSurfaceFormat::ResetNotification); |
| 468 |
} else if (m_format.renderableType() == QSurfaceFormat::OpenGLES && hasExtension("GL_EXT_robustness")) { |
| 469 |
GLint value = 0; |
| 470 |
glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_EXT, &value); |
| 471 |
if (value == GL_LOSE_CONTEXT_ON_RESET_EXT) |
| 472 |
m_format.setOption(QSurfaceFormat::ResetNotification); |
| 473 |
} |
| 474 |
} |
| 475 |
runGLChecks(); |
| 476 |
eglMakeCurrent(prevDisplay, prevSurfaceDraw, prevSurfaceRead, prevContext); |
| 477 |
} else { |
| 478 |
qWarning("QEGLPlatformContext: Failed to make temporary surface current, format not updated (%x)", eglGetError()); |
| 479 |
} |
| 480 |
if (tempSurface != EGL_NO_SURFACE) |
| 481 |
destroyTemporaryOffscreenSurface(tempSurface); |
| 482 |
if (tempContext != EGL_NO_CONTEXT) |
| 483 |
eglDestroyContext(m_eglDisplay, tempContext); |
| 484 |
#endif // QT_NO_OPENGL |
| 485 |
} |
| 486 |
|
| 487 |
bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface) |
| 488 |
{ |
| 489 |
Q_ASSERT(surface->surface()->supportsOpenGL()); |
| 490 |
|
| 491 |
eglBindAPI(m_api); |
| 492 |
|
| 493 |
EGLSurface eglSurface = eglSurfaceForPlatformSurface(surface); |
| 494 |
|
| 495 |
if (!checkGraphicsReset()) |
| 496 |
return false; |
| 497 |
|
| 498 |
// shortcut: on some GPUs, eglMakeCurrent is not a cheap operation |
| 499 |
if (eglGetCurrentContext() == m_eglContext && |
| 500 |
eglGetCurrentDisplay() == m_eglDisplay && |
| 501 |
eglGetCurrentSurface(EGL_READ) == eglSurface && |
| 502 |
eglGetCurrentSurface(EGL_DRAW) == eglSurface) { |
| 503 |
return true; |
| 504 |
} |
| 505 |
|
| 506 |
const bool ok = eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_eglContext); |
| 507 |
if (ok) { |
| 508 |
if (!m_swapIntervalEnvChecked) { |
| 509 |
m_swapIntervalEnvChecked = true; |
| 510 |
if (qEnvironmentVariableIsSet("QT_QPA_EGLFS_SWAPINTERVAL")) { |
| 511 |
QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL"); |
| 512 |
bool intervalOk; |
| 513 |
const int swapInterval = swapIntervalString.toInt(&intervalOk); |
| 514 |
if (intervalOk) |
| 515 |
m_swapIntervalFromEnv = swapInterval; |
| 516 |
} |
| 517 |
} |
| 518 |
const int requestedSwapInterval = m_swapIntervalFromEnv >= 0 |
| 519 |
? m_swapIntervalFromEnv |
| 520 |
: surface->format().swapInterval(); |
| 521 |
if (requestedSwapInterval >= 0 && m_swapInterval != requestedSwapInterval) { |
| 522 |
m_swapInterval = requestedSwapInterval; |
| 523 |
if (eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context |
| 524 |
eglSwapInterval(eglDisplay(), m_swapInterval); |
| 525 |
} |
| 526 |
#if defined(Q_OS_VXWORKS) && defined(Q_PROCESSOR_X86_64) |
| 527 |
// Clear set of framebuffers as workaround for display artifacts found |
| 528 |
// in Wind River's Mesa OpenGL implementation |
| 529 |
static bool firstWindow = true; |
| 530 |
if (firstWindow && (QSurface::Window == surface->surface()->surfaceClass())) { |
| 531 |
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); |
| 532 |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
| 533 |
swapBuffers(surface); |
| 534 |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
| 535 |
swapBuffers(surface); |
| 536 |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
| 537 |
swapBuffers(surface); |
| 538 |
firstWindow = false; |
| 539 |
} |
| 540 |
#endif |
| 541 |
} else { |
| 542 |
qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError()); |
| 543 |
} |
| 544 |
|
| 545 |
return ok; |
| 546 |
} |
| 547 |
|
| 548 |
QEGLPlatformContext::~QEGLPlatformContext() |
| 549 |
{ |
| 550 |
if (m_ownsContext && m_eglContext != EGL_NO_CONTEXT) |
| 551 |
eglDestroyContext(m_eglDisplay, m_eglContext); |
| 552 |
|
| 553 |
m_eglContext = EGL_NO_CONTEXT; |
| 554 |
} |
| 555 |
|
| 556 |
void QEGLPlatformContext::doneCurrent() |
| 557 |
{ |
| 558 |
eglBindAPI(m_api); |
| 559 |
bool ok = eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); |
| 560 |
if (!ok) |
| 561 |
qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError()); |
| 562 |
} |
| 563 |
|
| 564 |
void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface) |
| 565 |
{ |
| 566 |
eglBindAPI(m_api); |
| 567 |
EGLSurface eglSurface = eglSurfaceForPlatformSurface(surface); |
| 568 |
if (eglSurface != EGL_NO_SURFACE) { // skip if using surfaceless context |
| 569 |
bool ok = eglSwapBuffers(m_eglDisplay, eglSurface); |
| 570 |
if (!ok) |
| 571 |
qWarning("QEGLPlatformContext: eglSwapBuffers failed: %x", eglGetError()); |
| 572 |
} |
| 573 |
} |
| 574 |
|
| 575 |
QFunctionPointer QEGLPlatformContext::getProcAddress(const char *procName) |
| 576 |
{ |
| 577 |
eglBindAPI(m_api); |
| 578 |
QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName); |
| 579 |
#if QT_CONFIG(dlopen) |
| 580 |
if (!proc) |
| 581 |
proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName); |
| 582 |
#elif !defined(QT_OPENGL_DYNAMIC) |
| 583 |
// On systems without KHR_get_all_proc_addresses and without |
| 584 |
// dynamic linking there still has to be a way to access the |
| 585 |
// standard GLES functions. QOpenGL(Extra)Functions never makes |
| 586 |
// direct GL API calls since Qt 5.7, so all such workarounds are |
| 587 |
// expected to be handled in the platform plugin. |
| 588 |
if (!proc) { |
| 589 |
static struct StdFunc { |
| 590 |
const char *name; |
| 591 |
QFunctionPointer func; |
| 592 |
} standardFuncs[] = { |
| 593 |
#if QT_CONFIG(opengles2) |
| 594 |
{ "glBindTexture", (QFunctionPointer) ::glBindTexture }, |
| 595 |
{ "glBlendFunc", (QFunctionPointer) ::glBlendFunc }, |
| 596 |
{ "glClear", (QFunctionPointer) ::glClear }, |
| 597 |
{ "glClearColor", (QFunctionPointer) ::glClearColor }, |
| 598 |
{ "glClearStencil", (QFunctionPointer) ::glClearStencil }, |
| 599 |
{ "glColorMask", (QFunctionPointer) ::glColorMask }, |
| 600 |
{ "glCopyTexImage2D", (QFunctionPointer) ::glCopyTexImage2D }, |
| 601 |
{ "glCopyTexSubImage2D", (QFunctionPointer) ::glCopyTexSubImage2D }, |
| 602 |
{ "glCullFace", (QFunctionPointer) ::glCullFace }, |
| 603 |
{ "glDeleteTextures", (QFunctionPointer) ::glDeleteTextures }, |
| 604 |
{ "glDepthFunc", (QFunctionPointer) ::glDepthFunc }, |
| 605 |
{ "glDepthMask", (QFunctionPointer) ::glDepthMask }, |
| 606 |
{ "glDisable", (QFunctionPointer) ::glDisable }, |
| 607 |
{ "glDrawArrays", (QFunctionPointer) ::glDrawArrays }, |
| 608 |
{ "glDrawElements", (QFunctionPointer) ::glDrawElements }, |
| 609 |
{ "glEnable", (QFunctionPointer) ::glEnable }, |
| 610 |
{ "glFinish", (QFunctionPointer) ::glFinish }, |
| 611 |
{ "glFlush", (QFunctionPointer) ::glFlush }, |
| 612 |
{ "glFrontFace", (QFunctionPointer) ::glFrontFace }, |
| 613 |
{ "glGenTextures", (QFunctionPointer) ::glGenTextures }, |
| 614 |
{ "glGetBooleanv", (QFunctionPointer) ::glGetBooleanv }, |
| 615 |
{ "glGetError", (QFunctionPointer) ::glGetError }, |
| 616 |
{ "glGetFloatv", (QFunctionPointer) ::glGetFloatv }, |
| 617 |
{ "glGetIntegerv", (QFunctionPointer) ::glGetIntegerv }, |
| 618 |
{ "glGetString", (QFunctionPointer) ::glGetString }, |
| 619 |
{ "glGetTexParameterfv", (QFunctionPointer) ::glGetTexParameterfv }, |
| 620 |
{ "glGetTexParameteriv", (QFunctionPointer) ::glGetTexParameteriv }, |
| 621 |
{ "glHint", (QFunctionPointer) ::glHint }, |
| 622 |
{ "glIsEnabled", (QFunctionPointer) ::glIsEnabled }, |
| 623 |
{ "glIsTexture", (QFunctionPointer) ::glIsTexture }, |
| 624 |
{ "glLineWidth", (QFunctionPointer) ::glLineWidth }, |
| 625 |
{ "glPixelStorei", (QFunctionPointer) ::glPixelStorei }, |
| 626 |
{ "glPolygonOffset", (QFunctionPointer) ::glPolygonOffset }, |
| 627 |
{ "glReadPixels", (QFunctionPointer) ::glReadPixels }, |
| 628 |
{ "glScissor", (QFunctionPointer) ::glScissor }, |
| 629 |
{ "glStencilFunc", (QFunctionPointer) ::glStencilFunc }, |
| 630 |
{ "glStencilMask", (QFunctionPointer) ::glStencilMask }, |
| 631 |
{ "glStencilOp", (QFunctionPointer) ::glStencilOp }, |
| 632 |
{ "glTexImage2D", (QFunctionPointer) ::glTexImage2D }, |
| 633 |
{ "glTexParameterf", (QFunctionPointer) ::glTexParameterf }, |
| 634 |
{ "glTexParameterfv", (QFunctionPointer) ::glTexParameterfv }, |
| 635 |
{ "glTexParameteri", (QFunctionPointer) ::glTexParameteri }, |
| 636 |
{ "glTexParameteriv", (QFunctionPointer) ::glTexParameteriv }, |
| 637 |
{ "glTexSubImage2D", (QFunctionPointer) ::glTexSubImage2D }, |
| 638 |
{ "glViewport", (QFunctionPointer) ::glViewport }, |
| 639 |
|
| 640 |
{ "glActiveTexture", (QFunctionPointer) ::glActiveTexture }, |
| 641 |
{ "glAttachShader", (QFunctionPointer) ::glAttachShader }, |
| 642 |
{ "glBindAttribLocation", (QFunctionPointer) ::glBindAttribLocation }, |
| 643 |
{ "glBindBuffer", (QFunctionPointer) ::glBindBuffer }, |
| 644 |
{ "glBindFramebuffer", (QFunctionPointer) ::glBindFramebuffer }, |
| 645 |
{ "glBindRenderbuffer", (QFunctionPointer) ::glBindRenderbuffer }, |
| 646 |
{ "glBlendColor", (QFunctionPointer) ::glBlendColor }, |
| 647 |
{ "glBlendEquation", (QFunctionPointer) ::glBlendEquation }, |
| 648 |
{ "glBlendEquationSeparate", (QFunctionPointer) ::glBlendEquationSeparate }, |
| 649 |
{ "glBlendFuncSeparate", (QFunctionPointer) ::glBlendFuncSeparate }, |
| 650 |
{ "glBufferData", (QFunctionPointer) ::glBufferData }, |
| 651 |
{ "glBufferSubData", (QFunctionPointer) ::glBufferSubData }, |
| 652 |
{ "glCheckFramebufferStatus", (QFunctionPointer) ::glCheckFramebufferStatus }, |
| 653 |
{ "glCompileShader", (QFunctionPointer) ::glCompileShader }, |
| 654 |
{ "glCompressedTexImage2D", (QFunctionPointer) ::glCompressedTexImage2D }, |
| 655 |
{ "glCompressedTexSubImage2D", (QFunctionPointer) ::glCompressedTexSubImage2D }, |
| 656 |
{ "glCreateProgram", (QFunctionPointer) ::glCreateProgram }, |
| 657 |
{ "glCreateShader", (QFunctionPointer) ::glCreateShader }, |
| 658 |
{ "glDeleteBuffers", (QFunctionPointer) ::glDeleteBuffers }, |
| 659 |
{ "glDeleteFramebuffers", (QFunctionPointer) ::glDeleteFramebuffers }, |
| 660 |
{ "glDeleteProgram", (QFunctionPointer) ::glDeleteProgram }, |
| 661 |
{ "glDeleteRenderbuffers", (QFunctionPointer) ::glDeleteRenderbuffers }, |
| 662 |
{ "glDeleteShader", (QFunctionPointer) ::glDeleteShader }, |
| 663 |
{ "glDetachShader", (QFunctionPointer) ::glDetachShader }, |
| 664 |
{ "glDisableVertexAttribArray", (QFunctionPointer) ::glDisableVertexAttribArray }, |
| 665 |
{ "glEnableVertexAttribArray", (QFunctionPointer) ::glEnableVertexAttribArray }, |
| 666 |
{ "glFramebufferRenderbuffer", (QFunctionPointer) ::glFramebufferRenderbuffer }, |
| 667 |
{ "glFramebufferTexture2D", (QFunctionPointer) ::glFramebufferTexture2D }, |
| 668 |
{ "glGenBuffers", (QFunctionPointer) ::glGenBuffers }, |
| 669 |
{ "glGenerateMipmap", (QFunctionPointer) ::glGenerateMipmap }, |
| 670 |
{ "glGenFramebuffers", (QFunctionPointer) ::glGenFramebuffers }, |
| 671 |
{ "glGenRenderbuffers", (QFunctionPointer) ::glGenRenderbuffers }, |
| 672 |
{ "glGetActiveAttrib", (QFunctionPointer) ::glGetActiveAttrib }, |
| 673 |
{ "glGetActiveUniform", (QFunctionPointer) ::glGetActiveUniform }, |
| 674 |
{ "glGetAttachedShaders", (QFunctionPointer) ::glGetAttachedShaders }, |
| 675 |
{ "glGetAttribLocation", (QFunctionPointer) ::glGetAttribLocation }, |
| 676 |
{ "glGetBufferParameteriv", (QFunctionPointer) ::glGetBufferParameteriv }, |
| 677 |
{ "glGetFramebufferAttachmentParameteriv", (QFunctionPointer) ::glGetFramebufferAttachmentParameteriv }, |
| 678 |
{ "glGetProgramiv", (QFunctionPointer) ::glGetProgramiv }, |
| 679 |
{ "glGetProgramInfoLog", (QFunctionPointer) ::glGetProgramInfoLog }, |
| 680 |
{ "glGetRenderbufferParameteriv", (QFunctionPointer) ::glGetRenderbufferParameteriv }, |
| 681 |
{ "glGetShaderiv", (QFunctionPointer) ::glGetShaderiv }, |
| 682 |
{ "glGetShaderInfoLog", (QFunctionPointer) ::glGetShaderInfoLog }, |
| 683 |
{ "glGetShaderPrecisionFormat", (QFunctionPointer) ::glGetShaderPrecisionFormat }, |
| 684 |
{ "glGetShaderSource", (QFunctionPointer) ::glGetShaderSource }, |
| 685 |
{ "glGetUniformfv", (QFunctionPointer) ::glGetUniformfv }, |
| 686 |
{ "glGetUniformiv", (QFunctionPointer) ::glGetUniformiv }, |
| 687 |
{ "glGetUniformLocation", (QFunctionPointer) ::glGetUniformLocation }, |
| 688 |
{ "glGetVertexAttribfv", (QFunctionPointer) ::glGetVertexAttribfv }, |
| 689 |
{ "glGetVertexAttribiv", (QFunctionPointer) ::glGetVertexAttribiv }, |
| 690 |
{ "glGetVertexAttribPointerv", (QFunctionPointer) ::glGetVertexAttribPointerv }, |
| 691 |
{ "glIsBuffer", (QFunctionPointer) ::glIsBuffer }, |
| 692 |
{ "glIsFramebuffer", (QFunctionPointer) ::glIsFramebuffer }, |
| 693 |
{ "glIsProgram", (QFunctionPointer) ::glIsProgram }, |
| 694 |
{ "glIsRenderbuffer", (QFunctionPointer) ::glIsRenderbuffer }, |
| 695 |
{ "glIsShader", (QFunctionPointer) ::glIsShader }, |
| 696 |
{ "glLinkProgram", (QFunctionPointer) ::glLinkProgram }, |
| 697 |
{ "glReleaseShaderCompiler", (QFunctionPointer) ::glReleaseShaderCompiler }, |
| 698 |
{ "glRenderbufferStorage", (QFunctionPointer) ::glRenderbufferStorage }, |
| 699 |
{ "glSampleCoverage", (QFunctionPointer) ::glSampleCoverage }, |
| 700 |
{ "glShaderBinary", (QFunctionPointer) ::glShaderBinary }, |
| 701 |
{ "glShaderSource", (QFunctionPointer) ::glShaderSource }, |
| 702 |
{ "glStencilFuncSeparate", (QFunctionPointer) ::glStencilFuncSeparate }, |
| 703 |
{ "glStencilMaskSeparate", (QFunctionPointer) ::glStencilMaskSeparate }, |
| 704 |
{ "glStencilOpSeparate", (QFunctionPointer) ::glStencilOpSeparate }, |
| 705 |
{ "glUniform1f", (QFunctionPointer) ::glUniform1f }, |
| 706 |
{ "glUniform1fv", (QFunctionPointer) ::glUniform1fv }, |
| 707 |
{ "glUniform1i", (QFunctionPointer) ::glUniform1i }, |
| 708 |
{ "glUniform1iv", (QFunctionPointer) ::glUniform1iv }, |
| 709 |
{ "glUniform2f", (QFunctionPointer) ::glUniform2f }, |
| 710 |
{ "glUniform2fv", (QFunctionPointer) ::glUniform2fv }, |
| 711 |
{ "glUniform2i", (QFunctionPointer) ::glUniform2i }, |
| 712 |
{ "glUniform2iv", (QFunctionPointer) ::glUniform2iv }, |
| 713 |
{ "glUniform3f", (QFunctionPointer) ::glUniform3f }, |
| 714 |
{ "glUniform3fv", (QFunctionPointer) ::glUniform3fv }, |
| 715 |
{ "glUniform3i", (QFunctionPointer) ::glUniform3i }, |
| 716 |
{ "glUniform3iv", (QFunctionPointer) ::glUniform3iv }, |
| 717 |
{ "glUniform4f", (QFunctionPointer) ::glUniform4f }, |
| 718 |
{ "glUniform4fv", (QFunctionPointer) ::glUniform4fv }, |
| 719 |
{ "glUniform4i", (QFunctionPointer) ::glUniform4i }, |
| 720 |
{ "glUniform4iv", (QFunctionPointer) ::glUniform4iv }, |
| 721 |
{ "glUniformMatrix2fv", (QFunctionPointer) ::glUniformMatrix2fv }, |
| 722 |
{ "glUniformMatrix3fv", (QFunctionPointer) ::glUniformMatrix3fv }, |
| 723 |
{ "glUniformMatrix4fv", (QFunctionPointer) ::glUniformMatrix4fv }, |
| 724 |
{ "glUseProgram", (QFunctionPointer) ::glUseProgram }, |
| 725 |
{ "glValidateProgram", (QFunctionPointer) ::glValidateProgram }, |
| 726 |
{ "glVertexAttrib1f", (QFunctionPointer) ::glVertexAttrib1f }, |
| 727 |
{ "glVertexAttrib1fv", (QFunctionPointer) ::glVertexAttrib1fv }, |
| 728 |
{ "glVertexAttrib2f", (QFunctionPointer) ::glVertexAttrib2f }, |
| 729 |
{ "glVertexAttrib2fv", (QFunctionPointer) ::glVertexAttrib2fv }, |
| 730 |
{ "glVertexAttrib3f", (QFunctionPointer) ::glVertexAttrib3f }, |
| 731 |
{ "glVertexAttrib3fv", (QFunctionPointer) ::glVertexAttrib3fv }, |
| 732 |
{ "glVertexAttrib4f", (QFunctionPointer) ::glVertexAttrib4f }, |
| 733 |
{ "glVertexAttrib4fv", (QFunctionPointer) ::glVertexAttrib4fv }, |
| 734 |
{ "glVertexAttribPointer", (QFunctionPointer) ::glVertexAttribPointer }, |
| 735 |
|
| 736 |
{ "glClearDepthf", (QFunctionPointer) ::glClearDepthf }, |
| 737 |
{ "glDepthRangef", (QFunctionPointer) ::glDepthRangef }, |
| 738 |
#endif // QT_CONFIG(opengles2) |
| 739 |
|
| 740 |
#if QT_CONFIG(opengles3) |
| 741 |
{ "glBeginQuery", (QFunctionPointer) ::glBeginQuery }, |
| 742 |
{ "glBeginTransformFeedback", (QFunctionPointer) ::glBeginTransformFeedback }, |
| 743 |
{ "glBindBufferBase", (QFunctionPointer) ::glBindBufferBase }, |
| 744 |
{ "glBindBufferRange", (QFunctionPointer) ::glBindBufferRange }, |
| 745 |
{ "glBindSampler", (QFunctionPointer) ::glBindSampler }, |
| 746 |
{ "glBindTransformFeedback", (QFunctionPointer) ::glBindTransformFeedback }, |
| 747 |
{ "glBindVertexArray", (QFunctionPointer) ::glBindVertexArray }, |
| 748 |
{ "glBlitFramebuffer", (QFunctionPointer) ::glBlitFramebuffer }, |
| 749 |
{ "glClearBufferfi", (QFunctionPointer) ::glClearBufferfi }, |
| 750 |
{ "glClearBufferfv", (QFunctionPointer) ::glClearBufferfv }, |
| 751 |
{ "glClearBufferiv", (QFunctionPointer) ::glClearBufferiv }, |
| 752 |
{ "glClearBufferuiv", (QFunctionPointer) ::glClearBufferuiv }, |
| 753 |
{ "glClientWaitSync", (QFunctionPointer) ::glClientWaitSync }, |
| 754 |
{ "glCompressedTexImage3D", (QFunctionPointer) ::glCompressedTexImage3D }, |
| 755 |
{ "glCompressedTexSubImage3D", (QFunctionPointer) ::glCompressedTexSubImage3D }, |
| 756 |
{ "glCopyBufferSubData", (QFunctionPointer) ::glCopyBufferSubData }, |
| 757 |
{ "glCopyTexSubImage3D", (QFunctionPointer) ::glCopyTexSubImage3D }, |
| 758 |
{ "glDeleteQueries", (QFunctionPointer) ::glDeleteQueries }, |
| 759 |
{ "glDeleteSamplers", (QFunctionPointer) ::glDeleteSamplers }, |
| 760 |
{ "glDeleteSync", (QFunctionPointer) ::glDeleteSync }, |
| 761 |
{ "glDeleteTransformFeedbacks", (QFunctionPointer) ::glDeleteTransformFeedbacks }, |
| 762 |
{ "glDeleteVertexArrays", (QFunctionPointer) ::glDeleteVertexArrays }, |
| 763 |
{ "glDrawArraysInstanced", (QFunctionPointer) ::glDrawArraysInstanced }, |
| 764 |
{ "glDrawBuffers", (QFunctionPointer) ::glDrawBuffers }, |
| 765 |
{ "glDrawElementsInstanced", (QFunctionPointer) ::glDrawElementsInstanced }, |
| 766 |
{ "glDrawRangeElements", (QFunctionPointer) ::glDrawRangeElements }, |
| 767 |
{ "glEndQuery", (QFunctionPointer) ::glEndQuery }, |
| 768 |
{ "glEndTransformFeedback", (QFunctionPointer) ::glEndTransformFeedback }, |
| 769 |
{ "glFenceSync", (QFunctionPointer) ::glFenceSync }, |
| 770 |
{ "glFlushMappedBufferRange", (QFunctionPointer) ::glFlushMappedBufferRange }, |
| 771 |
{ "glFramebufferTextureLayer", (QFunctionPointer) ::glFramebufferTextureLayer }, |
| 772 |
{ "glGenQueries", (QFunctionPointer) ::glGenQueries }, |
| 773 |
{ "glGenSamplers", (QFunctionPointer) ::glGenSamplers }, |
| 774 |
{ "glGenTransformFeedbacks", (QFunctionPointer) ::glGenTransformFeedbacks }, |
| 775 |
{ "glGenVertexArrays", (QFunctionPointer) ::glGenVertexArrays }, |
| 776 |
{ "glGetActiveUniformBlockName", (QFunctionPointer) ::glGetActiveUniformBlockName }, |
| 777 |
{ "glGetActiveUniformBlockiv", (QFunctionPointer) ::glGetActiveUniformBlockiv }, |
| 778 |
{ "glGetActiveUniformsiv", (QFunctionPointer) ::glGetActiveUniformsiv }, |
| 779 |
{ "glGetBufferParameteri64v", (QFunctionPointer) ::glGetBufferParameteri64v }, |
| 780 |
{ "glGetBufferPointerv", (QFunctionPointer) ::glGetBufferPointerv }, |
| 781 |
{ "glGetFragDataLocation", (QFunctionPointer) ::glGetFragDataLocation }, |
| 782 |
{ "glGetInteger64i_v", (QFunctionPointer) ::glGetInteger64i_v }, |
| 783 |
{ "glGetInteger64v", (QFunctionPointer) ::glGetInteger64v }, |
| 784 |
{ "glGetIntegeri_v", (QFunctionPointer) ::glGetIntegeri_v }, |
| 785 |
{ "glGetInternalformativ", (QFunctionPointer) ::glGetInternalformativ }, |
| 786 |
{ "glGetProgramBinary", (QFunctionPointer) ::glGetProgramBinary }, |
| 787 |
{ "glGetQueryObjectuiv", (QFunctionPointer) ::glGetQueryObjectuiv }, |
| 788 |
{ "glGetQueryiv", (QFunctionPointer) ::glGetQueryiv }, |
| 789 |
{ "glGetSamplerParameterfv", (QFunctionPointer) ::glGetSamplerParameterfv }, |
| 790 |
{ "glGetSamplerParameteriv", (QFunctionPointer) ::glGetSamplerParameteriv }, |
| 791 |
{ "glGetStringi", (QFunctionPointer) ::glGetStringi }, |
| 792 |
{ "glGetSynciv", (QFunctionPointer) ::glGetSynciv }, |
| 793 |
{ "glGetTransformFeedbackVarying", (QFunctionPointer) ::glGetTransformFeedbackVarying }, |
| 794 |
{ "glGetUniformBlockIndex", (QFunctionPointer) ::glGetUniformBlockIndex }, |
| 795 |
{ "glGetUniformIndices", (QFunctionPointer) ::glGetUniformIndices }, |
| 796 |
{ "glGetUniformuiv", (QFunctionPointer) ::glGetUniformuiv }, |
| 797 |
{ "glGetVertexAttribIiv", (QFunctionPointer) ::glGetVertexAttribIiv }, |
| 798 |
{ "glGetVertexAttribIuiv", (QFunctionPointer) ::glGetVertexAttribIuiv }, |
| 799 |
{ "glInvalidateFramebuffer", (QFunctionPointer) ::glInvalidateFramebuffer }, |
| 800 |
{ "glInvalidateSubFramebuffer", (QFunctionPointer) ::glInvalidateSubFramebuffer }, |
| 801 |
{ "glIsQuery", (QFunctionPointer) ::glIsQuery }, |
| 802 |
{ "glIsSampler", (QFunctionPointer) ::glIsSampler }, |
| 803 |
{ "glIsSync", (QFunctionPointer) ::glIsSync }, |
| 804 |
{ "glIsTransformFeedback", (QFunctionPointer) ::glIsTransformFeedback }, |
| 805 |
{ "glIsVertexArray", (QFunctionPointer) ::glIsVertexArray }, |
| 806 |
{ "glMapBufferRange", (QFunctionPointer) ::glMapBufferRange }, |
| 807 |
{ "glPauseTransformFeedback", (QFunctionPointer) ::glPauseTransformFeedback }, |
| 808 |
{ "glProgramBinary", (QFunctionPointer) ::glProgramBinary }, |
| 809 |
{ "glProgramParameteri", (QFunctionPointer) ::glProgramParameteri }, |
| 810 |
{ "glReadBuffer", (QFunctionPointer) ::glReadBuffer }, |
| 811 |
{ "glRenderbufferStorageMultisample", (QFunctionPointer) ::glRenderbufferStorageMultisample }, |
| 812 |
{ "glResumeTransformFeedback", (QFunctionPointer) ::glResumeTransformFeedback }, |
| 813 |
{ "glSamplerParameterf", (QFunctionPointer) ::glSamplerParameterf }, |
| 814 |
{ "glSamplerParameterfv", (QFunctionPointer) ::glSamplerParameterfv }, |
| 815 |
{ "glSamplerParameteri", (QFunctionPointer) ::glSamplerParameteri }, |
| 816 |
{ "glSamplerParameteriv", (QFunctionPointer) ::glSamplerParameteriv }, |
| 817 |
{ "glTexImage3D", (QFunctionPointer) ::glTexImage3D }, |
| 818 |
{ "glTexStorage2D", (QFunctionPointer) ::glTexStorage2D }, |
| 819 |
{ "glTexStorage3D", (QFunctionPointer) ::glTexStorage3D }, |
| 820 |
{ "glTexSubImage3D", (QFunctionPointer) ::glTexSubImage3D }, |
| 821 |
{ "glTransformFeedbackVaryings", (QFunctionPointer) ::glTransformFeedbackVaryings }, |
| 822 |
{ "glUniform1ui", (QFunctionPointer) ::glUniform1ui }, |
| 823 |
{ "glUniform1uiv", (QFunctionPointer) ::glUniform1uiv }, |
| 824 |
{ "glUniform2ui", (QFunctionPointer) ::glUniform2ui }, |
| 825 |
{ "glUniform2uiv", (QFunctionPointer) ::glUniform2uiv }, |
| 826 |
{ "glUniform3ui", (QFunctionPointer) ::glUniform3ui }, |
| 827 |
{ "glUniform3uiv", (QFunctionPointer) ::glUniform3uiv }, |
| 828 |
{ "glUniform4ui", (QFunctionPointer) ::glUniform4ui }, |
| 829 |
{ "glUniform4uiv", (QFunctionPointer) ::glUniform4uiv }, |
| 830 |
{ "glUniformBlockBinding", (QFunctionPointer) ::glUniformBlockBinding }, |
| 831 |
{ "glUniformMatrix2x3fv", (QFunctionPointer) ::glUniformMatrix2x3fv }, |
| 832 |
{ "glUniformMatrix2x4fv", (QFunctionPointer) ::glUniformMatrix2x4fv }, |
| 833 |
{ "glUniformMatrix3x2fv", (QFunctionPointer) ::glUniformMatrix3x2fv }, |
| 834 |
{ "glUniformMatrix3x4fv", (QFunctionPointer) ::glUniformMatrix3x4fv }, |
| 835 |
{ "glUniformMatrix4x2fv", (QFunctionPointer) ::glUniformMatrix4x2fv }, |
| 836 |
{ "glUniformMatrix4x3fv", (QFunctionPointer) ::glUniformMatrix4x3fv }, |
| 837 |
{ "glUnmapBuffer", (QFunctionPointer) ::glUnmapBuffer }, |
| 838 |
{ "glVertexAttribDivisor", (QFunctionPointer) ::glVertexAttribDivisor }, |
| 839 |
{ "glVertexAttribI4i", (QFunctionPointer) ::glVertexAttribI4i }, |
| 840 |
{ "glVertexAttribI4iv", (QFunctionPointer) ::glVertexAttribI4iv }, |
| 841 |
{ "glVertexAttribI4ui", (QFunctionPointer) ::glVertexAttribI4ui }, |
| 842 |
{ "glVertexAttribI4uiv", (QFunctionPointer) ::glVertexAttribI4uiv }, |
| 843 |
{ "glVertexAttribIPointer", (QFunctionPointer) ::glVertexAttribIPointer }, |
| 844 |
{ "glWaitSync", (QFunctionPointer) ::glWaitSync }, |
| 845 |
#endif // QT_CONFIG(opengles3) |
| 846 |
|
| 847 |
#if QT_CONFIG(opengles31) |
| 848 |
{ "glActiveShaderProgram", (QFunctionPointer) ::glActiveShaderProgram }, |
| 849 |
{ "glBindImageTexture", (QFunctionPointer) ::glBindImageTexture }, |
| 850 |
{ "glBindProgramPipeline", (QFunctionPointer) ::glBindProgramPipeline }, |
| 851 |
{ "glBindVertexBuffer", (QFunctionPointer) ::glBindVertexBuffer }, |
| 852 |
{ "glCreateShaderProgramv", (QFunctionPointer) ::glCreateShaderProgramv }, |
| 853 |
{ "glDeleteProgramPipelines", (QFunctionPointer) ::glDeleteProgramPipelines }, |
| 854 |
{ "glDispatchCompute", (QFunctionPointer) ::glDispatchCompute }, |
| 855 |
{ "glDispatchComputeIndirect", (QFunctionPointer) ::glDispatchComputeIndirect }, |
| 856 |
{ "glDrawArraysIndirect", (QFunctionPointer) ::glDrawArraysIndirect }, |
| 857 |
{ "glDrawElementsIndirect", (QFunctionPointer) ::glDrawElementsIndirect }, |
| 858 |
{ "glFramebufferParameteri", (QFunctionPointer) ::glFramebufferParameteri }, |
| 859 |
{ "glGenProgramPipelines", (QFunctionPointer) ::glGenProgramPipelines }, |
| 860 |
{ "glGetBooleani_v", (QFunctionPointer) ::glGetBooleani_v }, |
| 861 |
{ "glGetFramebufferParameteriv", (QFunctionPointer) ::glGetFramebufferParameteriv }, |
| 862 |
{ "glGetMultisamplefv", (QFunctionPointer) ::glGetMultisamplefv }, |
| 863 |
{ "glGetProgramInterfaceiv", (QFunctionPointer) ::glGetProgramInterfaceiv }, |
| 864 |
{ "glGetProgramPipelineInfoLog", (QFunctionPointer) ::glGetProgramPipelineInfoLog }, |
| 865 |
{ "glGetProgramPipelineiv", (QFunctionPointer) ::glGetProgramPipelineiv }, |
| 866 |
{ "glGetProgramResourceIndex", (QFunctionPointer) ::glGetProgramResourceIndex }, |
| 867 |
{ "glGetProgramResourceLocation", (QFunctionPointer) ::glGetProgramResourceLocation }, |
| 868 |
{ "glGetProgramResourceName", (QFunctionPointer) ::glGetProgramResourceName }, |
| 869 |
{ "glGetProgramResourceiv", (QFunctionPointer) ::glGetProgramResourceiv }, |
| 870 |
{ "glGetTexLevelParameterfv", (QFunctionPointer) ::glGetTexLevelParameterfv }, |
| 871 |
{ "glGetTexLevelParameteriv", (QFunctionPointer) ::glGetTexLevelParameteriv }, |
| 872 |
{ "glIsProgramPipeline", (QFunctionPointer) ::glIsProgramPipeline }, |
| 873 |
{ "glMemoryBarrier", (QFunctionPointer) ::glMemoryBarrier }, |
| 874 |
{ "glMemoryBarrierByRegion", (QFunctionPointer) ::glMemoryBarrierByRegion }, |
| 875 |
{ "glProgramUniform1f", (QFunctionPointer) ::glProgramUniform1f }, |
| 876 |
{ "glProgramUniform1fv", (QFunctionPointer) ::glProgramUniform1fv }, |
| 877 |
{ "glProgramUniform1i", (QFunctionPointer) ::glProgramUniform1i }, |
| 878 |
{ "glProgramUniform1iv", (QFunctionPointer) ::glProgramUniform1iv }, |
| 879 |
{ "glProgramUniform1ui", (QFunctionPointer) ::glProgramUniform1ui }, |
| 880 |
{ "glProgramUniform1uiv", (QFunctionPointer) ::glProgramUniform1uiv }, |
| 881 |
{ "glProgramUniform2f", (QFunctionPointer) ::glProgramUniform2f }, |
| 882 |
{ "glProgramUniform2fv", (QFunctionPointer) ::glProgramUniform2fv }, |
| 883 |
{ "glProgramUniform2i", (QFunctionPointer) ::glProgramUniform2i }, |
| 884 |
{ "glProgramUniform2iv", (QFunctionPointer) ::glProgramUniform2iv }, |
| 885 |
{ "glProgramUniform2ui", (QFunctionPointer) ::glProgramUniform2ui }, |
| 886 |
{ "glProgramUniform2uiv", (QFunctionPointer) ::glProgramUniform2uiv }, |
| 887 |
{ "glProgramUniform3f", (QFunctionPointer) ::glProgramUniform3f }, |
| 888 |
{ "glProgramUniform3fv", (QFunctionPointer) ::glProgramUniform3fv }, |
| 889 |
{ "glProgramUniform3i", (QFunctionPointer) ::glProgramUniform3i }, |
| 890 |
{ "glProgramUniform3iv", (QFunctionPointer) ::glProgramUniform3iv }, |
| 891 |
{ "glProgramUniform3ui", (QFunctionPointer) ::glProgramUniform3ui }, |
| 892 |
{ "glProgramUniform3uiv", (QFunctionPointer) ::glProgramUniform3uiv }, |
| 893 |
{ "glProgramUniform4f", (QFunctionPointer) ::glProgramUniform4f }, |
| 894 |
{ "glProgramUniform4fv", (QFunctionPointer) ::glProgramUniform4fv }, |
| 895 |
{ "glProgramUniform4i", (QFunctionPointer) ::glProgramUniform4i }, |
| 896 |
{ "glProgramUniform4iv", (QFunctionPointer) ::glProgramUniform4iv }, |
| 897 |
{ "glProgramUniform4ui", (QFunctionPointer) ::glProgramUniform4ui }, |
| 898 |
{ "glProgramUniform4uiv", (QFunctionPointer) ::glProgramUniform4uiv }, |
| 899 |
{ "glProgramUniformMatrix2fv", (QFunctionPointer) ::glProgramUniformMatrix2fv }, |
| 900 |
{ "glProgramUniformMatrix2x3fv", (QFunctionPointer) ::glProgramUniformMatrix2x3fv }, |
| 901 |
{ "glProgramUniformMatrix2x4fv", (QFunctionPointer) ::glProgramUniformMatrix2x4fv }, |
| 902 |
{ "glProgramUniformMatrix3fv", (QFunctionPointer) ::glProgramUniformMatrix3fv }, |
| 903 |
{ "glProgramUniformMatrix3x2fv", (QFunctionPointer) ::glProgramUniformMatrix3x2fv }, |
| 904 |
{ "glProgramUniformMatrix3x4fv", (QFunctionPointer) ::glProgramUniformMatrix3x4fv }, |
| 905 |
{ "glProgramUniformMatrix4fv", (QFunctionPointer) ::glProgramUniformMatrix4fv }, |
| 906 |
{ "glProgramUniformMatrix4x2fv", (QFunctionPointer) ::glProgramUniformMatrix4x2fv }, |
| 907 |
{ "glProgramUniformMatrix4x3fv", (QFunctionPointer) ::glProgramUniformMatrix4x3fv }, |
| 908 |
{ "glSampleMaski", (QFunctionPointer) ::glSampleMaski }, |
| 909 |
{ "glTexStorage2DMultisample", (QFunctionPointer) ::glTexStorage2DMultisample }, |
| 910 |
{ "glUseProgramStages", (QFunctionPointer) ::glUseProgramStages }, |
| 911 |
{ "glValidateProgramPipeline", (QFunctionPointer) ::glValidateProgramPipeline }, |
| 912 |
{ "glVertexAttribBinding", (QFunctionPointer) ::glVertexAttribBinding }, |
| 913 |
{ "glVertexAttribFormat", (QFunctionPointer) ::glVertexAttribFormat }, |
| 914 |
{ "glVertexAttribIFormat", (QFunctionPointer) ::glVertexAttribIFormat }, |
| 915 |
{ "glVertexBindingDivisor", (QFunctionPointer) ::glVertexBindingDivisor }, |
| 916 |
#endif // QT_CONFIG(opengles31) |
| 917 |
|
| 918 |
#if QT_CONFIG(opengles32) |
| 919 |
{ "glBlendBarrier", (QFunctionPointer) ::glBlendBarrier }, |
| 920 |
{ "glCopyImageSubData", (QFunctionPointer) ::glCopyImageSubData }, |
| 921 |
{ "glDebugMessageControl", (QFunctionPointer) ::glDebugMessageControl }, |
| 922 |
{ "glDebugMessageInsert", (QFunctionPointer) ::glDebugMessageInsert }, |
| 923 |
{ "glDebugMessageCallback", (QFunctionPointer) ::glDebugMessageCallback }, |
| 924 |
{ "glGetDebugMessageLog", (QFunctionPointer) ::glGetDebugMessageLog }, |
| 925 |
{ "glPushDebugGroup", (QFunctionPointer) ::glPushDebugGroup }, |
| 926 |
{ "glPopDebugGroup", (QFunctionPointer) ::glPopDebugGroup }, |
| 927 |
{ "glObjectLabel", (QFunctionPointer) ::glObjectLabel }, |
| 928 |
{ "glGetObjectLabel", (QFunctionPointer) ::glGetObjectLabel }, |
| 929 |
{ "glObjectPtrLabel", (QFunctionPointer) ::glObjectPtrLabel }, |
| 930 |
{ "glGetObjectPtrLabel", (QFunctionPointer) ::glGetObjectPtrLabel }, |
| 931 |
{ "glGetPointerv", (QFunctionPointer) ::glGetPointerv }, |
| 932 |
{ "glEnablei", (QFunctionPointer) ::glEnablei }, |
| 933 |
{ "glDisablei", (QFunctionPointer) ::glDisablei }, |
| 934 |
{ "glBlendEquationi", (QFunctionPointer) ::glBlendEquationi }, |
| 935 |
{ "glBlendEquationSeparatei", (QFunctionPointer) ::glBlendEquationSeparatei }, |
| 936 |
{ "glBlendFunci", (QFunctionPointer) ::glBlendFunci }, |
| 937 |
{ "glBlendFuncSeparatei", (QFunctionPointer) ::glBlendFuncSeparatei }, |
| 938 |
{ "glColorMaski", (QFunctionPointer) ::glColorMaski }, |
| 939 |
{ "glIsEnabledi", (QFunctionPointer) ::glIsEnabledi }, |
| 940 |
{ "glDrawElementsBaseVertex", (QFunctionPointer) ::glDrawElementsBaseVertex }, |
| 941 |
{ "glDrawRangeElementsBaseVertex", (QFunctionPointer) ::glDrawRangeElementsBaseVertex }, |
| 942 |
{ "glDrawElementsInstancedBaseVertex", (QFunctionPointer) ::glDrawElementsInstancedBaseVertex }, |
| 943 |
{ "glFramebufferTexture", (QFunctionPointer) ::glFramebufferTexture }, |
| 944 |
{ "glPrimitiveBoundingBox", (QFunctionPointer) ::glPrimitiveBoundingBox }, |
| 945 |
{ "glGetGraphicsResetStatus", (QFunctionPointer) ::glGetGraphicsResetStatus }, |
| 946 |
{ "glReadnPixels", (QFunctionPointer) ::glReadnPixels }, |
| 947 |
{ "glGetnUniformfv", (QFunctionPointer) ::glGetnUniformfv }, |
| 948 |
{ "glGetnUniformiv", (QFunctionPointer) ::glGetnUniformiv }, |
| 949 |
{ "glGetnUniformuiv", (QFunctionPointer) ::glGetnUniformuiv }, |
| 950 |
{ "glMinSampleShading", (QFunctionPointer) ::glMinSampleShading }, |
| 951 |
{ "glPatchParameteri", (QFunctionPointer) ::glPatchParameteri }, |
| 952 |
{ "glTexParameterIiv", (QFunctionPointer) ::glTexParameterIiv }, |
| 953 |
{ "glTexParameterIuiv", (QFunctionPointer) ::glTexParameterIuiv }, |
| 954 |
{ "glGetTexParameterIiv", (QFunctionPointer) ::glGetTexParameterIiv }, |
| 955 |
{ "glGetTexParameterIuiv", (QFunctionPointer) ::glGetTexParameterIuiv }, |
| 956 |
{ "glSamplerParameterIiv", (QFunctionPointer) ::glSamplerParameterIiv }, |
| 957 |
{ "glSamplerParameterIuiv", (QFunctionPointer) ::glSamplerParameterIuiv }, |
| 958 |
{ "glGetSamplerParameterIiv", (QFunctionPointer) ::glGetSamplerParameterIiv }, |
| 959 |
{ "glGetSamplerParameterIuiv", (QFunctionPointer) ::glGetSamplerParameterIuiv }, |
| 960 |
{ "glTexBuffer", (QFunctionPointer) ::glTexBuffer }, |
| 961 |
{ "glTexBufferRange", (QFunctionPointer) ::glTexBufferRange }, |
| 962 |
{ "glTexStorage3DMultisample", (QFunctionPointer) ::glTexStorage3DMultisample }, |
| 963 |
#endif // QT_CONFIG(opengles32) |
| 964 |
}; |
| 965 |
|
| 966 |
for (size_t i = 0; i < sizeof(standardFuncs) / sizeof(StdFunc); ++i) { |
| 967 |
if (!qstrcmp(procName, standardFuncs[i].name)) { |
| 968 |
proc = standardFuncs[i].func; |
| 969 |
break; |
| 970 |
} |
| 971 |
} |
| 972 |
} |
| 973 |
#endif |
| 974 |
|
| 975 |
return proc; |
| 976 |
} |
| 977 |
|
| 978 |
QSurfaceFormat QEGLPlatformContext::format() const |
| 979 |
{ |
| 980 |
return m_format; |
| 981 |
} |
| 982 |
|
| 983 |
EGLContext QEGLPlatformContext::eglContext() const |
| 984 |
{ |
| 985 |
return m_eglContext; |
| 986 |
} |
| 987 |
|
| 988 |
EGLDisplay QEGLPlatformContext::eglDisplay() const |
| 989 |
{ |
| 990 |
return m_eglDisplay; |
| 991 |
} |
| 992 |
|
| 993 |
EGLConfig QEGLPlatformContext::eglConfig() const |
| 994 |
{ |
| 995 |
return m_eglConfig; |
| 996 |
} |
| 997 |
|
| 998 |
bool QEGLPlatformContext::checkGraphicsReset() |
| 999 |
{ |
| 1000 |
if (m_getGraphicsResetStatus && m_getGraphicsResetStatus() != GL_NO_ERROR) { |
| 1001 |
invalidateContext(); |
| 1002 |
return false; |
| 1003 |
} else { |
| 1004 |
return true; |
| 1005 |
} |
| 1006 |
} |
| 1007 |
|
| 1008 |
QT_END_NAMESPACE |