Shader: Add module ID (UUID)

This commit is contained in:
Jérôme Leclercq
2022-03-05 15:25:27 +01:00
parent 43ac86e85c
commit 53728200ac
9 changed files with 72 additions and 46 deletions

View File

@@ -304,13 +304,7 @@ namespace Nz::ShaderLang
if (!moduleVersion.has_value())
throw AttributeError{ "missing module version" };
m_context->module = std::make_shared<ShaderAst::Module>();
m_context->module->rootNode = ShaderBuilder::MultiStatement();
std::shared_ptr<ShaderAst::Module::Metadata> moduleMetadata = std::make_shared<ShaderAst::Module::Metadata>();
moduleMetadata->shaderLangVersion = *moduleVersion;
m_context->module->metadata = std::move(moduleMetadata);
m_context->module = std::make_shared<ShaderAst::Module>(*moduleVersion);
Expect(Advance(), TokenType::Semicolon);
}