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>
This commit is contained in:
Laszlo Agocs 2015-02-18 15:01:33 +01:00
parent 02c5657a7d
commit 97f451a600

View File

@ -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)