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>)
|
||||
PopulateFieldList(arg, prefix + member.name + ".");
|
||||
else
|
||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
},
|
||||
member.type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include <Nazara/Shader/ShaderBuilder.hpp>
|
||||
#include <QtWidgets/QDoubleSpinBox>
|
||||
#include <QtWidgets/QFormLayout>
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <stdexcept>
|
||||
|
||||
template<std::size_t ToComponentCount>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ struct VecExpressionTypeHelper<4>
|
|||
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 {};
|
||||
|
|
@ -86,7 +86,7 @@ struct VecTypeHelper<4>
|
|||
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' };
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ m_type(ShaderType::NotSet)
|
|||
{ "position", PrimitiveType::Float3 },
|
||||
{ "normal", PrimitiveType::Float3 },
|
||||
{ "uv", PrimitiveType::Float2 },
|
||||
{ "inner", 2 }
|
||||
{ "inner", 2u }
|
||||
}
|
||||
});
|
||||
AddStruct("InnerStruct", {
|
||||
|
|
@ -74,7 +74,7 @@ m_type(ShaderType::NotSet)
|
|||
});
|
||||
AddStruct("OuterStruct", {
|
||||
{
|
||||
{ "a", 1 },
|
||||
{ "a", 1u },
|
||||
{ "b", PrimitiveType::Float1 }
|
||||
}
|
||||
});
|
||||
|
|
@ -266,7 +266,7 @@ void ShaderGraph::Load(const QJsonObject& data)
|
|||
if (typeDocRef.isString())
|
||||
memberInfo.type = DecodeEnum<PrimitiveType>(typeDocRef.toString().toStdString()).value();
|
||||
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>)
|
||||
memberDoc["type"] = int(arg);
|
||||
else
|
||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
}, member.type);
|
||||
|
||||
memberArray.append(std::move(memberDoc));
|
||||
|
|
@ -535,7 +535,7 @@ Nz::ShaderExpressionType ShaderGraph::ToShaderExpressionType(const std::variant<
|
|||
return s.name;
|
||||
}
|
||||
else
|
||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
}, type);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ Nz::ShaderAst MainWindow::ToShader()
|
|||
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||
member.type = m_shaderGraph.GetStruct(arg).name;
|
||||
else
|
||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
}, sMember.type);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ QString StructEditDialog::GetMemberName(const StructInfo::Member& member)
|
|||
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||
name += QString::fromStdString(m_shaderGraph.GetStruct(arg).name);
|
||||
else
|
||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
},
|
||||
member.type);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ StructMemberEditDialog(shaderGraph, parent)
|
|||
else if constexpr (std::is_same_v<T, std::size_t>)
|
||||
m_typeList->setCurrentIndex(static_cast<int>(PrimitiveTypeCount + arg));
|
||||
else
|
||||
static_assert(AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
static_assert(Nz::AlwaysFalse<T>::value, "non-exhaustive visitor");
|
||||
},
|
||||
member.type);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue