mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 05:12:25 +08:00
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:
parent
d1a05ce1b4
commit
573fc6fe13
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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"};
|
||||
}
|
||||
|
||||
|
||||
|
@ -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") {
|
||||
|
Loading…
Reference in New Issue
Block a user