chore: fix pass uniforms not taking into account fragment shader's uniforms

chore: keep processed code in the shader sent to opengl so it appears on RenderDoc
This commit is contained in:
Almamu 2025-05-09 02:43:48 +02:00
parent d1a05ce1b4
commit 573fc6fe13
5 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@
using namespace WallpaperEngine::Core::Objects::Effects::Constants;
CShaderConstantProperty::CShaderConstantProperty (std::shared_ptr <const CProperty> property) {
CShaderConstantProperty::CShaderConstantProperty (const std::shared_ptr <const CProperty>& property) {
property->connectOutgoing (this);
}

View File

@ -13,7 +13,7 @@ using namespace WallpaperEngine::Core::Projects;
*/
class CShaderConstantProperty : public CShaderConstant {
public:
explicit CShaderConstantProperty (std::shared_ptr <const CProperty> property);
explicit CShaderConstantProperty (const std::shared_ptr <const CProperty>& property);
[[nodiscard]] std::string toString () const override;
};

View File

@ -675,7 +675,7 @@ void CPass::setupShaderVariables () {
if (this->m_uniforms.find (cur->getName ()) == this->m_uniforms.end ())
this->addUniform (cur);
for (const auto& cur : this->m_shader->getVertex ().getParameters ())
for (const auto& cur : this->m_shader->getFragment ().getParameters ())
if (this->m_uniforms.find (cur->getName ()) == this->m_uniforms.end ())
this->addUniform (cur);

View File

@ -191,7 +191,7 @@ std::pair<std::string, std::string> CGLSLContext::toGlsl (const std::string& ver
options.es = false;
fragmentCompiler .set_common_options(options);
return {vertexCompiler.compile(), fragmentCompiler.compile()};
return {vertexCompiler.compile() + "#if 0\n" + vertex + "#endif", fragmentCompiler.compile() + "#if 0\n" + fragment + "#endif"};
}

View File

@ -383,7 +383,7 @@ void CShaderUnit::parseParameterConfiguration (
// TODO: SUPPORT VALUES FOR ALL THESE TYPES
// TODO: MAYBE EVEN CONNECT THESE TO THE CORRESPONDING PROPERTY SO THINGS ARE UPDATED AS THE ORIGIN VALUES CHANGE?
if (type == "vec4") {
parameter = new Variables::CShaderVariableVector4(WallpaperEngine::Core::aToVector4 (*defvalue));
parameter = new Variables::CShaderVariableVector4 (WallpaperEngine::Core::aToVector4 (*defvalue));
} else if (type == "vec3") {
parameter = new Variables::CShaderVariableVector3 (WallpaperEngine::Core::aToVector3 (*defvalue));
} else if (type == "vec2") {