Fixed RenderTarget tracking not being notified to update its active target when an FBO RenderTexture is display()ed. Fixes #2630

This commit is contained in:
binary1248 2023-10-08 01:06:35 +02:00 committed by Chris Thrasher
parent c0061797e3
commit fe778028a2

View File

@ -158,9 +158,22 @@ bool RenderTexture::setActive(bool active)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void RenderTexture::display() void RenderTexture::display()
{ {
// Update the target texture if (m_impl)
if (m_impl && (priv::RenderTextureImplFBO::isAvailable() || setActive(true)))
{ {
if (priv::RenderTextureImplFBO::isAvailable())
{
// Perform a RenderTarget-only activation if we are using FBOs
if (!RenderTarget::setActive())
return;
}
else
{
// Perform a full activation if we are not using FBOs
if (!setActive())
return;
}
// Update the target texture
m_impl->updateTexture(m_texture.m_texture); m_impl->updateTexture(m_texture.m_texture);
m_texture.m_pixelsFlipped = true; m_texture.m_pixelsFlipped = true;
m_texture.invalidateMipmap(); m_texture.invalidateMipmap();