From 97f451a600c474a2484c621cc66b0f29fe9c76c4 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 18 Feb 2015 15:01:33 +0100 Subject: 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 --- src/gui/opengl/qopengltexture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui/opengl') 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) -- cgit v1.2.3