Add opt-in compile flag for GL read back emulation (#2305)

Co-authored-by: Christophe Dehais <christophe.dehais@fittingbox.com>
This commit is contained in:
Christophe Dehais 2020-11-05 23:54:17 +01:00 committed by GitHub
parent 70f8897056
commit 6b790dc96b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -2764,7 +2764,7 @@ namespace bgfx { namespace gl
: 0
;
g_caps.supported |= m_readBackSupported
g_caps.supported |= (m_readBackSupported || BX_ENABLED(BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION))
? BGFX_CAPS_TEXTURE_READ_BACK
: 0
;
@ -3263,7 +3263,7 @@ namespace bgfx { namespace gl
GL_CHECK(glBindTexture(texture.m_target, 0) );
}
else
else if (BX_ENABLED(BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION))
{
const TextureGL& texture = m_textures[_handle.idx];
const bool compressed = bimg::isCompressed(bimg::TextureFormat::Enum(texture.m_textureFormat) );

View File

@ -43,6 +43,10 @@
# define BGFX_GL_CONFIG_BLIT_EMULATION 0
#endif // BGFX_GL_CONFIG_BLIT_EMULATION
#ifndef BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION
# define BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION 0
#endif // BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION
#define BGFX_GL_PROFILER_BEGIN(_view, _abgr) \
BX_MACRO_BLOCK_BEGIN \
GL_CHECK(glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, s_viewName[view]) ); \