diff options
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index fbaff74561..6915433aed 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -372,20 +372,8 @@ int QOpenGLContextPrivate::maxTextureSize() GLint next = 64; funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - QOpenGLFunctions_1_0 *gl1funcs = nullptr; - QOpenGLFunctions_3_2_Core *gl3funcs = nullptr; - - if (q->format().profile() == QSurfaceFormat::CoreProfile) - gl3funcs = q->versionFunctions<QOpenGLFunctions_3_2_Core>(); - else - gl1funcs = q->versionFunctions<QOpenGLFunctions_1_0>(); - - Q_ASSERT(gl1funcs || gl3funcs); - - if (gl1funcs) - gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size); - else - gl3funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size); + QOpenGLExtraFunctions *extraFuncs = q->extraFunctions(); + extraFuncs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size); if (size == 0) { return max_texture_size; @@ -397,11 +385,7 @@ int QOpenGLContextPrivate::maxTextureSize() if (next > max_texture_size) break; funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - if (gl1funcs) - gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next); - else - gl3funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next); - + extraFuncs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next); } while (next > size); max_texture_size = size; |