Fix ShaderNodes on macos
This commit is contained in:
parent
ddc8fffed1
commit
9a613c6fd6
|
|
@ -332,7 +332,7 @@ void BufferField::PopulateFieldList(std::size_t structIndex, const std::string&
|
||||||
else if constexpr (std::is_same_v<T, std::size_t>)
|
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||||
PopulateFieldList(arg, prefix + member.name + ".");
|
PopulateFieldList(arg, prefix + member.name + ".");
|
||||||
else
|
else
|
||||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||||
},
|
},
|
||||||
member.type);
|
member.type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#include <Nazara/Shader/ShaderBuilder.hpp>
|
#include <Nazara/Shader/ShaderBuilder.hpp>
|
||||||
#include <QtWidgets/QDoubleSpinBox>
|
#include <QtWidgets/QDoubleSpinBox>
|
||||||
#include <QtWidgets/QFormLayout>
|
#include <QtWidgets/QFormLayout>
|
||||||
|
#include <QtCore/QJsonArray>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
template<std::size_t ToComponentCount>
|
template<std::size_t ToComponentCount>
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ struct VecExpressionTypeHelper<4>
|
||||||
static constexpr Nz::ShaderNodes::BasicType ExpressionType = Nz::ShaderNodes::BasicType::Float4;
|
static constexpr Nz::ShaderNodes::BasicType ExpressionType = Nz::ShaderNodes::BasicType::Float4;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<std::size_t N> constexpr Nz::ShaderNodes::BasicType VecExpressionType = VecExpressionTypeHelper<N>::template ExpressionType;
|
template<std::size_t N> constexpr Nz::ShaderNodes::BasicType VecExpressionType = VecExpressionTypeHelper<N>::ExpressionType;
|
||||||
|
|
||||||
|
|
||||||
struct VecTypeDummy {};
|
struct VecTypeDummy {};
|
||||||
|
|
@ -86,7 +86,7 @@ struct VecTypeHelper<4>
|
||||||
using Type = Nz::Vector4f;
|
using Type = Nz::Vector4f;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<std::size_t N> using VecType = typename VecTypeHelper<N>::template Type;
|
template<std::size_t N> using VecType = typename VecTypeHelper<N>::Type;
|
||||||
|
|
||||||
constexpr std::array<char, 4> s_vectorComponents = { 'X', 'Y', 'Z', 'W' };
|
constexpr std::array<char, 4> s_vectorComponents = { 'X', 'Y', 'Z', 'W' };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ m_type(ShaderType::NotSet)
|
||||||
{ "position", PrimitiveType::Float3 },
|
{ "position", PrimitiveType::Float3 },
|
||||||
{ "normal", PrimitiveType::Float3 },
|
{ "normal", PrimitiveType::Float3 },
|
||||||
{ "uv", PrimitiveType::Float2 },
|
{ "uv", PrimitiveType::Float2 },
|
||||||
{ "inner", 2 }
|
{ "inner", 2u }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AddStruct("InnerStruct", {
|
AddStruct("InnerStruct", {
|
||||||
|
|
@ -74,7 +74,7 @@ m_type(ShaderType::NotSet)
|
||||||
});
|
});
|
||||||
AddStruct("OuterStruct", {
|
AddStruct("OuterStruct", {
|
||||||
{
|
{
|
||||||
{ "a", 1 },
|
{ "a", 1u },
|
||||||
{ "b", PrimitiveType::Float1 }
|
{ "b", PrimitiveType::Float1 }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -266,7 +266,7 @@ void ShaderGraph::Load(const QJsonObject& data)
|
||||||
if (typeDocRef.isString())
|
if (typeDocRef.isString())
|
||||||
memberInfo.type = DecodeEnum<PrimitiveType>(typeDocRef.toString().toStdString()).value();
|
memberInfo.type = DecodeEnum<PrimitiveType>(typeDocRef.toString().toStdString()).value();
|
||||||
else
|
else
|
||||||
memberInfo.type = typeDocRef.toInt();
|
memberInfo.type = static_cast<std::size_t>(typeDocRef.toInt());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -363,7 +363,7 @@ QJsonObject ShaderGraph::Save()
|
||||||
else if constexpr (std::is_same_v<T, std::size_t>)
|
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||||
memberDoc["type"] = int(arg);
|
memberDoc["type"] = int(arg);
|
||||||
else
|
else
|
||||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||||
}, member.type);
|
}, member.type);
|
||||||
|
|
||||||
memberArray.append(std::move(memberDoc));
|
memberArray.append(std::move(memberDoc));
|
||||||
|
|
@ -535,7 +535,7 @@ Nz::ShaderExpressionType ShaderGraph::ToShaderExpressionType(const std::variant<
|
||||||
return s.name;
|
return s.name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||||
}, type);
|
}, type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -269,7 +269,7 @@ Nz::ShaderAst MainWindow::ToShader()
|
||||||
else if constexpr (std::is_same_v<T, std::size_t>)
|
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||||
member.type = m_shaderGraph.GetStruct(arg).name;
|
member.type = m_shaderGraph.GetStruct(arg).name;
|
||||||
else
|
else
|
||||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||||
}, sMember.type);
|
}, sMember.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ QString StructEditDialog::GetMemberName(const StructInfo::Member& member)
|
||||||
else if constexpr (std::is_same_v<T, std::size_t>)
|
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||||
name += QString::fromStdString(m_shaderGraph.GetStruct(arg).name);
|
name += QString::fromStdString(m_shaderGraph.GetStruct(arg).name);
|
||||||
else
|
else
|
||||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||||
},
|
},
|
||||||
member.type);
|
member.type);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ StructMemberEditDialog(shaderGraph, parent)
|
||||||
else if constexpr (std::is_same_v<T, std::size_t>)
|
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||||
m_typeList->setCurrentIndex(static_cast<int>(PrimitiveTypeCount + arg));
|
m_typeList->setCurrentIndex(static_cast<int>(PrimitiveTypeCount + arg));
|
||||||
else
|
else
|
||||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||||
},
|
},
|
||||||
member.type);
|
member.type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue