summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/opengl/qopenglextensions_p.h1
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp8
-rw-r--r--src/gui/rhi/qrhi_p.h3
-rw-r--r--src/gui/rhi/qrhid3d11.cpp2
-rw-r--r--src/gui/rhi/qrhigles2.cpp3
-rw-r--r--src/gui/rhi/qrhigles2_p_p.h4
-rw-r--r--src/gui/rhi/qrhimetal.mm2
-rw-r--r--src/gui/rhi/qrhivulkan.cpp2
8 files changed, 22 insertions, 3 deletions
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h
index 137f1e831f..0d58b5f301 100644
--- a/src/gui/opengl/qopenglextensions_p.h
+++ b/src/gui/opengl/qopenglextensions_p.h
@@ -92,6 +92,7 @@ public:
DiscardFramebuffer = 0x00400000,
Sized16Formats = 0x00800000,
TextureSwizzle = 0x01000000,
+ StandardDerivatives = 0x02000000,
};
Q_DECLARE_FLAGS(OpenGLExtensions, OpenGLExtension)
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index a95f064ac5..7c17d3798b 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -376,6 +376,8 @@ static int qt_gl_resolve_extensions()
extensions |= QOpenGLExtensions::PixelBufferObject;
if (extensionMatcher.match("GL_ARB_texture_swizzle") || extensionMatcher.match("GL_EXT_texture_swizzle"))
extensions |= QOpenGLExtensions::TextureSwizzle;
+ if (extensionMatcher.match("GL_OES_standard_derivatives"))
+ extensions |= QOpenGLExtensions::StandardDerivatives;
if (ctx->isOpenGLES()) {
if (format.majorVersion() >= 2)
@@ -388,7 +390,8 @@ static int qt_gl_resolve_extensions()
| QOpenGLExtensions::MapBufferRange
| QOpenGLExtensions::FramebufferBlit
| QOpenGLExtensions::FramebufferMultisample
- | QOpenGLExtensions::Sized8Formats;
+ | QOpenGLExtensions::Sized8Formats
+ | QOpenGLExtensions::StandardDerivatives;
#ifndef Q_OS_WASM
// WebGL 2.0 specification explicitly does not support texture swizzles
// https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.19
@@ -445,6 +448,9 @@ static int qt_gl_resolve_extensions()
if (format.version() >= qMakePair(1, 4) || extensionMatcher.match("GL_SGIS_generate_mipmap"))
extensions |= QOpenGLExtensions::GenerateMipmap;
+ if (format.majorVersion() >= 2)
+ extensions |= QOpenGLExtensions::StandardDerivatives;
+
if (format.majorVersion() >= 3 || extensionMatcher.match("GL_ARB_framebuffer_object")) {
extensions |= QOpenGLExtensions::FramebufferMultisample
| QOpenGLExtensions::FramebufferBlit
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h
index bd476c3927..9f94fea1dc 100644
--- a/src/gui/rhi/qrhi_p.h
+++ b/src/gui/rhi/qrhi_p.h
@@ -1456,7 +1456,8 @@ public:
ReadBackNonBaseMipLevel,
TexelFetch,
RenderToNonBaseMipLevel,
- UIntAttributes
+ UIntAttributes,
+ ScreenSpaceDerivatives
};
enum BeginFrameFlag {
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index c284e17f46..710ebd62cc 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -479,6 +479,8 @@ bool QRhiD3D11::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::UIntAttributes:
return true;
+ case QRhi::ScreenSpaceDerivatives:
+ return true;
default:
Q_UNREACHABLE();
return false;
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp
index ebe66f302b..632a5154e7 100644
--- a/src/gui/rhi/qrhigles2.cpp
+++ b/src/gui/rhi/qrhigles2.cpp
@@ -522,6 +522,7 @@ bool QRhiGles2::create(QRhi::Flags flags)
caps.texelFetch = caps.ctxMajor >= 3; // 3.0 or ES 3.0
caps.uintAttributes = caps.ctxMajor >= 3; // 3.0 or ES 3.0
+ caps.screenSpaceDerivatives = f->hasOpenGLExtension(QOpenGLExtensions::StandardDerivatives);
if (!caps.gles) {
f->glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
@@ -872,6 +873,8 @@ bool QRhiGles2::isFeatureSupported(QRhi::Feature feature) const
return caps.nonBaseLevelFramebufferTexture;
case QRhi::UIntAttributes:
return caps.uintAttributes;
+ case QRhi::ScreenSpaceDerivatives:
+ return caps.screenSpaceDerivatives;
default:
Q_UNREACHABLE();
return false;
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h
index 2c393da3b4..03ed81dfb2 100644
--- a/src/gui/rhi/qrhigles2_p_p.h
+++ b/src/gui/rhi/qrhigles2_p_p.h
@@ -869,7 +869,8 @@ public:
properMapBuffer(false),
nonBaseLevelFramebufferTexture(false),
texelFetch(false),
- uintAttributes(true)
+ uintAttributes(true),
+ screenSpaceDerivatives(false)
{ }
int ctxMajor;
int ctxMinor;
@@ -904,6 +905,7 @@ public:
uint nonBaseLevelFramebufferTexture : 1;
uint texelFetch : 1;
uint uintAttributes : 1;
+ uint screenSpaceDerivatives : 1;
} caps;
QGles2SwapChain *currentSwapChain = nullptr;
QVector<GLint> supportedCompressedFormats;
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
index b249dc55cc..0c42eaa3e9 100644
--- a/src/gui/rhi/qrhimetal.mm
+++ b/src/gui/rhi/qrhimetal.mm
@@ -568,6 +568,8 @@ bool QRhiMetal::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::UIntAttributes:
return true;
+ case QRhi::ScreenSpaceDerivatives:
+ return true;
default:
Q_UNREACHABLE();
return false;
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index 59898d3839..fdc80e1e80 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -4050,6 +4050,8 @@ bool QRhiVulkan::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::UIntAttributes:
return true;
+ case QRhi::ScreenSpaceDerivatives:
+ return true;
default:
Q_UNREACHABLE();
return false;