Shader: Add export attribute for structs ([export])
This commit is contained in:
@@ -148,6 +148,7 @@ namespace Nz::ShaderAst
|
||||
{
|
||||
auto clone = std::make_unique<DeclareStructStatement>();
|
||||
clone->structIndex = node.structIndex;
|
||||
clone->isExported = Clone(node.isExported);
|
||||
|
||||
clone->description.layout = Clone(node.description.layout);
|
||||
clone->description.name = node.description.name;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Shader/Ast/AstSerializer.hpp>
|
||||
#include <Nazara/Shader/ShaderBuilder.hpp>
|
||||
#include <Nazara/Shader/Ast/AstExpressionVisitor.hpp>
|
||||
#include <Nazara/Shader/Ast/AstStatementVisitor.hpp>
|
||||
#include <Nazara/Shader/ShaderBuilder.hpp>
|
||||
#include <Nazara/Shader/Debug.hpp>
|
||||
|
||||
namespace Nz::ShaderAst
|
||||
@@ -249,6 +249,7 @@ namespace Nz::ShaderAst
|
||||
void AstSerializerBase::Serialize(DeclareStructStatement& node)
|
||||
{
|
||||
OptVal(node.structIndex);
|
||||
ExprValue(node.isExported);
|
||||
|
||||
Value(node.description.name);
|
||||
ExprValue(node.description.layout);
|
||||
|
||||
@@ -939,6 +939,9 @@ namespace Nz::ShaderAst
|
||||
|
||||
auto clone = static_unique_pointer_cast<DeclareStructStatement>(AstCloner::Clone(node));
|
||||
|
||||
if (clone->isExported.HasValue())
|
||||
clone->isExported = ComputeExprValue(clone->isExported);
|
||||
|
||||
std::unordered_set<std::string> declaredMembers;
|
||||
for (auto& member : clone->description.members)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user