Make use of GL_APPLE_texture_format_BGRA8888.
Texture uploads on iOS is extremly slow without it. Change-Id: Icccd542b8122c7bfa0e839c25e988d107bc17d2a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
95d35ab188
commit
2991947c31
|
@ -149,6 +149,11 @@ Atlas::Atlas(const QSize &size)
|
|||
|| strstr(ext, "GL_EXT_texture_format_BGRA8888")
|
||||
|| strstr(ext, "GL_IMG_texture_format_BGRA8888")) {
|
||||
m_internalFormat = m_externalFormat = GL_BGRA;
|
||||
#ifdef Q_OS_IOS
|
||||
} else if (strstr(ext, "GL_APPLE_texture_format_BGRA8888")) {
|
||||
m_internalFormat = GL_RGBA;
|
||||
m_externalFormat = GL_BGRA;
|
||||
#endif
|
||||
} else {
|
||||
m_internalFormat = m_externalFormat = GL_RGBA;
|
||||
}
|
||||
|
|
|
@ -692,6 +692,11 @@ void QSGPlainTexture::bind()
|
|||
|| context->hasExtension(QByteArrayLiteral("GL_IMG_texture_format_BGRA8888"))) {
|
||||
externalFormat = GL_BGRA;
|
||||
internalFormat = GL_BGRA;
|
||||
#ifdef Q_OS_IOS
|
||||
} else if (strstr(extensions, "GL_APPLE_texture_format_BGRA8888")) {
|
||||
externalFormat = GL_BGRA;
|
||||
internalFormat = GL_RGBA;
|
||||
#endif
|
||||
} else {
|
||||
qsg_swizzleBGRAToRGBA(&tmp);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue