Handle shader options of any type

This commit is contained in:
Jérôme Leclercq
2021-09-03 19:33:41 +02:00
parent 2f9e495739
commit 02a12d9328
38 changed files with 236 additions and 1118 deletions

View File

@@ -463,7 +463,7 @@ namespace Nz
if (!states.sanitized)
{
ShaderAst::SanitizeVisitor::Options options;
options.enabledOptions = states.enabledOptions;
options.optionValues = states.optionValues;
sanitizedAst = ShaderAst::Sanitize(shader, options);
targetAst = sanitizedAst.get();
@@ -653,11 +653,6 @@ namespace Nz
return m_currentState->constantTypeCache.GetId(*m_currentState->constantTypeCache.BuildType(type));
}
bool SpirvWriter::IsOptionEnabled(std::size_t optionIndex) const
{
return TestBit<Nz::UInt64>(m_context.states->enabledOptions, optionIndex);
}
UInt32 SpirvWriter::RegisterConstant(const ShaderAst::ConstantValue& value)
{
return m_currentState->constantTypeCache.Register(*m_currentState->constantTypeCache.BuildConstant(value));