Fixed black screen on some GLES 2.0 devices.

It affects only GLES 2.0. The GLES >= 3.0 and OpenGL allow sized internal formats.
This commit is contained in:
Deve 2017-06-29 23:00:08 +02:00
parent 8462c552d1
commit f13f69851f

View File

@ -222,6 +222,14 @@ void STKTexture::reload(bool no_upload, uint8_t* preload_data,
unsigned int internal_format = m_single_channel ? GL_R8 : isSrgb() ? unsigned int internal_format = m_single_channel ? GL_R8 : isSrgb() ?
GL_SRGB8_ALPHA8 : GL_RGBA8; GL_SRGB8_ALPHA8 : GL_RGBA8;
// GLES 2.0 specs doesn't allow GL_RGBA8 internal format
#if defined(USE_GLES2)
if (!CVS->isGLSL())
{
internal_format = GL_RGBA;
}
#endif
#if !defined(USE_GLES2) #if !defined(USE_GLES2)
if (isMeshTexture() && CVS->isTextureCompressionEnabled()) if (isMeshTexture() && CVS->isTextureCompressionEnabled())
{ {