Fix shader generation unit tests

This commit is contained in:
Jérôme Leclercq
2021-06-16 15:46:14 +02:00
parent 298beaedc0
commit dfa46ebaa5
6 changed files with 41 additions and 50 deletions

View File

@@ -707,11 +707,8 @@ namespace Nz::ShaderAst
if (!extVar.bindingIndex)
throw AstError{ "external variable " + extVar.name + " requires a binding index" };
if (!extVar.bindingSet)
throw AstError{ "external variable " + extVar.name + " requires a binding set" };
UInt64 bindingIndex = *extVar.bindingIndex;
UInt64 bindingSet = *extVar.bindingSet;
UInt64 bindingSet = extVar.bindingSet.value_or(0);
UInt64 bindingKey = bindingSet << 32 | bindingIndex;
if (m_context->usedBindingIndexes.find(bindingKey) != m_context->usedBindingIndexes.end())
throw AstError{ "Binding (set=" + std::to_string(bindingSet) + ", binding=" + std::to_string(bindingIndex) + ") is already in use" };