mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 05:23:00 +01:00
Import glDrawBuffers() from WEBGL_draw_buffers extension (#2667)
This commit is contained in:
committed by
GitHub
parent
3ec6d59b47
commit
f44818b548
@@ -6799,22 +6799,19 @@ namespace bgfx { namespace gl
|
||||
|
||||
m_num = uint8_t(colorIdx);
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || s_renderGL->m_gles3 )
|
||||
if (0 == colorIdx && BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
|
||||
{
|
||||
if (0 == colorIdx)
|
||||
{
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
|
||||
{
|
||||
// When only depth is attached disable draw buffer to avoid
|
||||
// GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER.
|
||||
GL_CHECK(glDrawBuffer(GL_NONE) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_CHECK(glDrawBuffers(colorIdx, buffers) );
|
||||
}
|
||||
// When only depth is attached disable draw buffer to avoid
|
||||
// GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER.
|
||||
GL_CHECK(glDrawBuffer(GL_NONE) );
|
||||
}
|
||||
else if (g_caps.limits.maxFBAttachments > 0)
|
||||
{
|
||||
GL_CHECK(glDrawBuffers(colorIdx, buffers) );
|
||||
}
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || s_renderGL->m_gles3)
|
||||
{
|
||||
// Disable read buffer to avoid GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER.
|
||||
GL_CHECK(glReadBuffer(GL_NONE) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user