From 13bcd52e8c497f948a36337fcef8f7ae74d893bc Mon Sep 17 00:00:00 2001 From: Alexis Maiquez Date: Tue, 30 Nov 2021 23:49:08 +0100 Subject: [PATCH] ~ Fixed regression in composite layer handling ~ Properly fixed usage of "previous" as texture Signed-off-by: Alexis Maiquez --- src/WallpaperEngine/Render/Objects/CImage.cpp | 4 ++-- src/WallpaperEngine/Render/Objects/Effects/CPass.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WallpaperEngine/Render/Objects/CImage.cpp b/src/WallpaperEngine/Render/Objects/CImage.cpp index 9d87d20..7d661af 100644 --- a/src/WallpaperEngine/Render/Objects/CImage.cpp +++ b/src/WallpaperEngine/Render/Objects/CImage.cpp @@ -57,8 +57,8 @@ CImage::CImage (CScene* scene, Core::Objects::CImage* image) : nameA << "_rt_imageLayerComposite_" << this->getImage ()->getId () << "_a"; nameB << "_rt_imageLayerComposite_" << this->getImage ()->getId () << "_b"; - this->m_currentMainFBO = this->m_mainFBO = scene->createFBO (nameB.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ()); - this->m_currentSubFBO = this->m_subFBO = scene->createFBO (nameA.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ()); + this->m_currentMainFBO = this->m_mainFBO = scene->createFBO (nameA.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ()); + this->m_currentSubFBO = this->m_subFBO = scene->createFBO (nameB.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ()); GLfloat realWidth = this->m_texture->getRealWidth () / 2; GLfloat realHeight = this->m_texture->getRealHeight () / 2; diff --git a/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp b/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp index 7b2a73b..8d0668d 100644 --- a/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp +++ b/src/WallpaperEngine/Render/Objects/Effects/CPass.cpp @@ -40,7 +40,7 @@ ITexture* CPass::resolveTexture (ITexture* expected, int index, ITexture* previo if (it == this->m_fbos.end ()) return nullptr; - return (*it).second; + expected = (*it).second; } // first check in the binds and replace it if necessary @@ -417,7 +417,7 @@ void CPass::setupUniforms () namestream << "g_Texture" << index << "Resolution"; - texture = this->resolveTexture ((*cur), index); + texture = this->resolveTexture ((*cur), index, texture); this->addUniform (namestream.str (), texture->getResolution ()); lastTextureIndex ++; } @@ -437,7 +437,7 @@ void CPass::setupUniforms () namestream << "g_Texture" << (*cur).first << "Resolution"; - texture = this->resolveTexture ((*cur).second, (*cur).first); + texture = this->resolveTexture ((*cur).second, (*cur).first, texture); this->addUniform (namestream.str (), texture->getResolution ()); } } @@ -456,7 +456,7 @@ void CPass::setupUniforms () namestream << "g_Texture" << (*cur).first << "Resolution"; - texture = this->resolveTexture ((*cur).second, (*cur).first); + texture = this->resolveTexture ((*cur).second, (*cur).first, texture); this->addUniform (namestream.str (), texture->getResolution ()); } }