mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
Merge pull request #483 from jonnyhopper/master
Fix crash on some OpenGLES devices
This commit is contained in:
commit
bd8f21d1b0
1 changed files with 14 additions and 0 deletions
|
@ -1452,6 +1452,20 @@ namespace bgfx { namespace gl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef BGFX_CONFIG_RENDERER_OPENGLES
|
||||||
|
// on some older devices attempting glTexImage2D or glCompressedTexImage2D with unsupported compressed formats can crash
|
||||||
|
// so disable the format by setting to GL_ZERO
|
||||||
|
for (uint32_t ii = 0; ii < TextureFormat::Unknown; ++ii)
|
||||||
|
{
|
||||||
|
if ( !s_textureFormat[ ii ].m_supported )
|
||||||
|
{
|
||||||
|
s_textureFormat[ ii ].m_internalFmt = GL_ZERO;
|
||||||
|
s_textureFormat[ ii ].m_internalFmtSrgb = GL_ZERO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
|
if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
|
||||||
|| !isTextureFormatValid(TextureFormat::R8) )
|
|| !isTextureFormatValid(TextureFormat::R8) )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue