Fix creation of RGB texture with QOpenGLTexture/Qt3D on OpenGL ES 2.0

Modification of the function pixelFormatCompatibleWithInternalFormat to
not change RGB pixel format to RGBA one, allowing the creation of valid
RGB textures with Qt3D.

Task-number: QTBUG-66365
Change-Id: I5c3187a3fefaedf85140f80fbb7145e1a762805b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
David Crémoux 2018-02-13 13:46:11 +03:00 committed by Laszlo Agocs
parent 666d7745eb
commit 08f9dc1d32

View File

@ -778,6 +778,8 @@ static QOpenGLTexture::PixelFormat pixelFormatCompatibleWithInternalFormat(QOpen
return QOpenGLTexture::Alpha;
case QOpenGLTexture::RGBFormat:
return QOpenGLTexture::RGB;
case QOpenGLTexture::RGBAFormat:
return QOpenGLTexture::RGBA;