diff options
author | Jean-Michaƫl Celerier <jean-michael.celerier@kdab.com> | 2020-06-26 11:47:46 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2020-07-02 08:05:42 +0200 |
commit | b9588a800bda713d993736ab3c359a9d58e9aaf1 (patch) | |
tree | 2df4634864c0e2f3d5495e51ebbdf5ced34dbbb6 /src/gui/rhi/qrhigles2.cpp | |
parent | 05b60631a2cb5c5536490509ed5d41c08a967dc5 (diff) |
rhi: add support for D24 / D24S8 formats
Change-Id: I7ba14d30fa57bcb92cd764aed6c85cde853935b4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhigles2.cpp')
-rw-r--r-- | src/gui/rhi/qrhigles2.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index 9196a88199..db131c12b0 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -775,6 +775,18 @@ static inline void toGlTextureFormat(QRhiTexture::Format format, const QRhiGles2 *glformat = GL_DEPTH_COMPONENT; *gltype = GL_UNSIGNED_SHORT; break; + case QRhiTexture::D24: + *glintformat = GL_DEPTH_COMPONENT24; + *glsizedintformat = *glintformat; + *glformat = GL_DEPTH_COMPONENT; + *gltype = GL_UNSIGNED_SHORT; + break; + case QRhiTexture::D24S8: + *glintformat = GL_DEPTH24_STENCIL8; + *glsizedintformat = *glintformat; + *glformat = GL_DEPTH_STENCIL; + *gltype = GL_UNSIGNED_SHORT; + break; case QRhiTexture::D32F: *glintformat = GL_DEPTH_COMPONENT32F; *glsizedintformat = *glintformat; @@ -801,6 +813,12 @@ bool QRhiGles2::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture case QRhiTexture::D32F: return caps.depthTexture; + case QRhiTexture::D24: + return caps.depth24; + + case QRhiTexture::D24S8: + return caps.depth24 && caps.packedDepthStencil; + case QRhiTexture::BGRA8: return caps.bgraExternalFormat; |