summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-18 15:01:33 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-20 07:25:39 +0000
commit97f451a600c474a2484c621cc66b0f29fe9c76c4 (patch)
treef5d46a7e404434ef092c670622f97a6ee83ccdde /src/gui/opengl/qopengltexture.cpp
parent02c5657a7d6d30c6e874e29a0adcc38b58a45b7d (diff)
Correct pixel type for depth textures on ES
Byte is definitely wrong. GL_OES_depth_texture states that short or int are the only options, GL_UNSIGNED_BYTE is thus rejected. Let's ask for the highest (32 bits). There's no guarantee that the implementation honors this, but at least we tried. Change-Id: I14dd9d4ab56b0b69cdab341f95f47499786d174e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopengltexture.cpp')
-rw-r--r--src/gui/opengl/qopengltexture.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index b96bc6f346..f5218ef4f3 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -522,6 +522,8 @@ static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTe
return QOpenGLTexture::UInt8;
case QOpenGLTexture::DepthFormat:
+ return QOpenGLTexture::UInt32;
+
case QOpenGLTexture::AlphaFormat:
case QOpenGLTexture::RGBFormat:
case QOpenGLTexture::RGBAFormat:
@@ -1534,7 +1536,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value SRGB_Alpha_DXT5 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
\value SRGB_BP_UNorm Equivalent to GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
- \value DepthFormat Equivalent to GL_DEPTH_COMPONENT (OpenGL ES 2 only and when OES_depth_texture is present)
+ \value DepthFormat Equivalent to GL_DEPTH_COMPONENT (only OpenGL ES 3 or ES 2 with OES_depth_texture)
\value AlphaFormat Equivalent to GL_ALPHA (OpenGL ES 2 only)
\value RGBFormat Equivalent to GL_RGB (OpenGL ES 2 only)
\value RGBAFormat Equivalent to GL_RGBA (OpenGL ES 2 only)