summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2022-01-03 17:20:17 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2022-01-06 14:56:32 +0100
commit0d98a1faf7fa0b943c7513b8ef56c4e9db007b4b (patch)
treef71008f2c70209a68e3c978f41976089d70a0f1b /src/gui/opengl
parent0a59101495634a02e7b893682904f4cfc5898624 (diff)
rhi: gl: Do not just rely on GL_COMPRESSED_TEXTURE_FORMATS
Pick-to: 6.3 6.2 Task-number: QTBUG-98937 Change-Id: I64f2783ae64ad3ef77a389999ded4c9ba2c46ee5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopenglextensions_p.h2
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h
index 0d58b5f301..972a92aac6 100644
--- a/src/gui/opengl/qopenglextensions_p.h
+++ b/src/gui/opengl/qopenglextensions_p.h
@@ -93,6 +93,8 @@ public:
Sized16Formats = 0x00800000,
TextureSwizzle = 0x01000000,
StandardDerivatives = 0x02000000,
+ ASTCTextureCompression = 0x04000000,
+ ETC2TextureCompression = 0x08000000
};
Q_DECLARE_FLAGS(OpenGLExtensions, OpenGLExtension)
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index bc1bad2831..6192a49685 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -364,6 +364,8 @@ static int qt_gl_resolve_extensions()
extensions |= QOpenGLExtensions::ETC1TextureCompression;
if (extensionMatcher.match("GL_IMG_texture_compression_pvrtc"))
extensions |= QOpenGLExtensions::PVRTCTextureCompression;
+ if (extensionMatcher.match("GL_KHR_texture_compression_astc_ldr"))
+ extensions |= QOpenGLExtensions::ASTCTextureCompression;
if (extensionMatcher.match("GL_ARB_texture_mirrored_repeat"))
extensions |= QOpenGLExtensions::MirroredRepeat;
if (extensionMatcher.match("GL_EXT_stencil_two_side"))
@@ -391,7 +393,8 @@ static int qt_gl_resolve_extensions()
| QOpenGLExtensions::FramebufferBlit
| QOpenGLExtensions::FramebufferMultisample
| QOpenGLExtensions::Sized8Formats
- | QOpenGLExtensions::StandardDerivatives;
+ | QOpenGLExtensions::StandardDerivatives
+ | QOpenGLExtensions::ETC2TextureCompression;
#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
@@ -413,6 +416,8 @@ static int qt_gl_resolve_extensions()
extensions |= QOpenGLExtensions::FramebufferMultisample;
if (extensionMatcher.match("GL_OES_rgb8_rgba8"))
extensions |= QOpenGLExtensions::Sized8Formats;
+ if (extensionMatcher.match("GL_OES_compressed_ETC2_RGB8_texture"))
+ extensions |= QOpenGLExtensions::ETC2TextureCompression;
}
if (extensionMatcher.match("GL_OES_mapbuffer"))
@@ -481,6 +486,9 @@ static int qt_gl_resolve_extensions()
if (srgbCapableFramebuffers)
extensions |= QOpenGLExtensions::SRGBFrameBuffer;
}
+
+ if (extensionMatcher.match("GL_ARB_ES3_compatibility"))
+ extensions |= QOpenGLExtensions::ETC2TextureCompression;
}
return extensions;