Renderer: Add support for struct and UBO
This commit is contained in:
@@ -36,6 +36,24 @@ namespace Nz
|
||||
enumVal = static_cast<T>(value);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::OptEnum(std::optional<T>& optVal)
|
||||
{
|
||||
bool isWriting = IsWriting();
|
||||
|
||||
bool hasValue;
|
||||
if (isWriting)
|
||||
hasValue = optVal.has_value();
|
||||
|
||||
Value(hasValue);
|
||||
|
||||
if (!isWriting && hasValue)
|
||||
optVal.emplace();
|
||||
|
||||
if (optVal.has_value())
|
||||
Enum(optVal.value());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ShaderSerializerBase::OptVal(std::optional<T>& optVal)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user