summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBerthold Krevert <berthold.krevert@basyskom.com>2017-07-16 21:43:05 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-07-25 06:25:38 +0000
commita2db480db51748b381f18987790b5f2de8c0c911 (patch)
treeb184d50eb881e21eea096e71e0dea46422f30d4c /src
parenta51e7963e9a5b2a35c982e77f636ac4ca9a8cbc4 (diff)
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 <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/shapes/qquicknvprfunctions.cpp8
1 files changed, 6 insertions, 2 deletions
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<type>(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<type>(ctx->getProcAddress(#name))
-
bool QQuickNvprFunctionsPrivate::resolve()
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();