UberShader: Handle case where entry points come from imported modules

This commit is contained in:
SirLynix 2022-06-17 19:07:40 +02:00
parent f3c889c5d5
commit 813314b5d5
1 changed files with 2 additions and 1 deletions

View File

@ -100,6 +100,7 @@ namespace Nz
nzsl::Ast::SanitizeVisitor::Options sanitizeOptions;
sanitizeOptions.allowPartialSanitization = true;
sanitizeOptions.moduleResolver = Graphics::Instance()->GetShaderModuleResolver();
nzsl::Ast::ModulePtr sanitizedModule = nzsl::Ast::Sanitize(module, sanitizeOptions);
@ -122,7 +123,7 @@ namespace Nz
};
nzsl::Ast::ReflectVisitor reflect;
reflect.Reflect(*sanitizedModule->rootNode, callbacks);
reflect.Reflect(*sanitizedModule, callbacks);
if ((m_shaderStages & supportedStageType) != m_shaderStages)
throw std::runtime_error("shader doesn't support all required shader stages");