diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-11 15:11:16 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-13 10:08:23 +0100 |
commit | c262a698511519a57866b2c5fce386b0ec1e6905 (patch) | |
tree | bc9eeb197b6fcac04904f919207440a1f37bfb12 /src/gui/rhi/qrhi_p.h | |
parent | 042cd97884bb86dfd0bedaa63480d99846ab06bb (diff) |
rhi: gl: Add some enablers for supporting GL_TEXTURE_EXTERNAL_OES
From QRhi's perspective this consists of two things:
- A shader with samplerExternalOES in it cannot go through the standard
pipeline. Rather, a QShader with suitable GLSL code in it has to be
constructed manually. As this is something useful as an autotest
anyway, add a test case to the qshader autotest that demonstrates
this.
- When it comes to correctly calling glBindTexture, add a QRhiTexture
flag. The expectation is that an OpenGL-only client sets this in
combination with QRhiTexture::createFrom(), thus wrapping an existing
texture that then gets bound to the GL_TEXTURE_EXTERNAL_OES target
instead of our usual GL_TEXTURE_2D.
For completeness we also add a SamplerExternalOES variable type to
QShaderDescription, but the sampler type is not actually used by the
QRhi OpenGL backend, as it is the QRhiTexture that defines the
texture target.
Change-Id: I36b52325deb3703b59186ee3d726d0c3015bfc4b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi_p.h')
-rw-r--r-- | src/gui/rhi/qrhi_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index fc65587408..647f469dcf 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -745,7 +745,8 @@ public: UsedAsTransferSource = 1 << 5, UsedWithGenerateMips = 1 << 6, UsedWithLoadStore = 1 << 7, - UsedAsCompressedAtlas = 1 << 8 + UsedAsCompressedAtlas = 1 << 8, + ExternalOES = 1 << 9 }; Q_DECLARE_FLAGS(Flags, Flag) |