From a2db480db51748b381f18987790b5f2de8c0c911 Mon Sep 17 00:00:00 2001 From: Berthold Krevert Date: Sun, 16 Jul 2017 21:43:05 +0200 Subject: Check for GL_NV_path_rendering extension If resolving of glProgramPathFragmentInput fails, the nvpr renderer should not report that it is supported, so that the shape item can fallback to the geometry renderer. Task-number: QTBUG-61913 Change-Id: I0795b1dedc330432884d5214ee2492c757055a54 Reviewed-by: Laszlo Agocs --- src/imports/shapes/qquicknvprfunctions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquicknvprfunctions.cpp b/src/imports/shapes/qquicknvprfunctions.cpp index 0b92d4b4c0..409a59be7f 100644 --- a/src/imports/shapes/qquicknvprfunctions.cpp +++ b/src/imports/shapes/qquicknvprfunctions.cpp @@ -87,6 +87,8 @@ QSurfaceFormat QQuickNvprFunctions::format() return fmt; } +#define PROC(type, name) reinterpret_cast(ctx->getProcAddress(#name)) + /*! \return true if GL_NV_path_rendering is supported with the current OpenGL context. @@ -114,6 +116,10 @@ bool QQuickNvprFunctions::isSupported() if (!ctx->hasExtension(QByteArrayLiteral("GL_NV_path_rendering"))) return false; + // Check that GL_NV_Path_rendering extension is at least API revision 1.3 + if (!PROC(PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC, glProgramPathFragmentInputGenNV)) + return false; + // Do not check for DSA as the string may not be exposed on ES // drivers, yet the functions we need are resolvable. #if 0 @@ -199,8 +205,6 @@ bool QQuickNvprFunctions::createFragmentOnlyPipeline(const char *fragmentShaderS return true; } -#define PROC(type, name) reinterpret_cast(ctx->getProcAddress(#name)) - bool QQuickNvprFunctionsPrivate::resolve() { QOpenGLContext *ctx = QOpenGLContext::currentContext(); -- cgit v1.2.3