mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 22:03:12 +01:00
Changed so that isFramebufferFormatValid checks the format even if it is not supported as a normal texture. Changed so that isTextureValid passes check if format is only supported as FrameBuffer and flags match that. (#1530)
This commit is contained in:
committed by
Бранимир Караџић
parent
72bf5f9870
commit
e039d996fd
@@ -1571,8 +1571,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
|
||||
? tfi.m_internalFmtSrgb
|
||||
: tfi.m_internalFmt
|
||||
;
|
||||
if (GL_ZERO == internalFmt
|
||||
|| !tfi.m_supported)
|
||||
if (GL_ZERO == internalFmt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -5911,11 +5910,27 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
|
||||
|
||||
if (0 != texture.m_rbo)
|
||||
{
|
||||
GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER
|
||||
, attachment
|
||||
, GL_RENDERBUFFER
|
||||
, texture.m_rbo
|
||||
) );
|
||||
#if !(BGFX_CONFIG_RENDERER_OPENGL >= 30 || BGFX_CONFIG_RENDERER_OPENGLES >= 30)
|
||||
if (GL_DEPTH_STENCIL_ATTACHMENT == attachment)
|
||||
{
|
||||
GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER
|
||||
, GL_DEPTH_ATTACHMENT
|
||||
, GL_RENDERBUFFER
|
||||
, texture.m_rbo
|
||||
) );
|
||||
GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER
|
||||
, GL_STENCIL_ATTACHMENT
|
||||
, GL_RENDERBUFFER
|
||||
, texture.m_rbo
|
||||
) );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER
|
||||
, attachment
|
||||
, GL_RENDERBUFFER
|
||||
, texture.m_rbo
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user