From 8cb57e97251defeb2761839d0712118bd8b6101c Mon Sep 17 00:00:00 2001 From: Kaixo Gamorra <21697330-kaixoo@users.noreply.gitlab.com> Date: Mon, 21 Oct 2024 23:19:00 +0200 Subject: [PATCH 1/2] feat: add support for boolean property --- src/core/ShaderEffects/shadervaluehandler.cpp | 5 +++++ src/core/ShaderEffects/shadervaluehandler.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/core/ShaderEffects/shadervaluehandler.cpp b/src/core/ShaderEffects/shadervaluehandler.cpp index 2a35ffb21..03b136dd7 100644 --- a/src/core/ShaderEffects/shadervaluehandler.cpp +++ b/src/core/ShaderEffects/shadervaluehandler.cpp @@ -36,6 +36,11 @@ UniformSpecifier ShaderValueHandler::create(const GLint loc, { Q_ASSERT(loc >= 0); switch(mType) { + case GLValueType::Boolean: + return [loc, &engine, index](QGL33 * const gl) { + const auto val = engine.getGlValueDouble(index); + gl->glUniform1i(loc, static_cast(qRound(val))); + }; case GLValueType::Float: return [loc, &engine, index](QGL33 * const gl) { const auto val = engine.getGlValueDouble(index); diff --git a/src/core/ShaderEffects/shadervaluehandler.h b/src/core/ShaderEffects/shadervaluehandler.h index 89f9eb9e4..d41dd39ba 100644 --- a/src/core/ShaderEffects/shadervaluehandler.h +++ b/src/core/ShaderEffects/shadervaluehandler.h @@ -36,6 +36,7 @@ typedef std::function UniformSpecifier; enum class GLValueType { Float, Vec2, Vec3, Vec4, Int, iVec2, iVec3, iVec4, + Boolean, none }; From 163da4ed3562fce30a27cdec498e8f363d542f68 Mon Sep 17 00:00:00 2001 From: Kaixo Gamorra <21697330-kaixoo@users.noreply.gitlab.com> Date: Wed, 30 Oct 2024 22:01:53 +0200 Subject: [PATCH 2/2] Revert "feat: add support for boolean property" This reverts commit 8cb57e97251defeb2761839d0712118bd8b6101c. --- src/core/ShaderEffects/shadervaluehandler.cpp | 5 ----- src/core/ShaderEffects/shadervaluehandler.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/core/ShaderEffects/shadervaluehandler.cpp b/src/core/ShaderEffects/shadervaluehandler.cpp index 03b136dd7..2a35ffb21 100644 --- a/src/core/ShaderEffects/shadervaluehandler.cpp +++ b/src/core/ShaderEffects/shadervaluehandler.cpp @@ -36,11 +36,6 @@ UniformSpecifier ShaderValueHandler::create(const GLint loc, { Q_ASSERT(loc >= 0); switch(mType) { - case GLValueType::Boolean: - return [loc, &engine, index](QGL33 * const gl) { - const auto val = engine.getGlValueDouble(index); - gl->glUniform1i(loc, static_cast(qRound(val))); - }; case GLValueType::Float: return [loc, &engine, index](QGL33 * const gl) { const auto val = engine.getGlValueDouble(index); diff --git a/src/core/ShaderEffects/shadervaluehandler.h b/src/core/ShaderEffects/shadervaluehandler.h index d41dd39ba..89f9eb9e4 100644 --- a/src/core/ShaderEffects/shadervaluehandler.h +++ b/src/core/ShaderEffects/shadervaluehandler.h @@ -36,7 +36,6 @@ typedef std::function UniformSpecifier; enum class GLValueType { Float, Vec2, Vec3, Vec4, Int, iVec2, iVec3, iVec4, - Boolean, none };