ShaderLang: Add support for length intrinsic

This commit is contained in:
Jérôme Leclercq
2021-05-14 02:02:12 +02:00
parent 24f7b75654
commit 51ecff2912
8 changed files with 65 additions and 7 deletions

View File

@@ -54,9 +54,10 @@ namespace Nz::ShaderAst
enum class IntrinsicType
{
CrossProduct,
DotProduct,
SampleTexture
CrossProduct = 0,
DotProduct = 1,
Length = 3,
SampleTexture = 2,
};
enum class MemoryLayout

View File

@@ -57,6 +57,7 @@ namespace Nz
SpirvConstantCache::TypePtr BuildFunctionType(const ShaderAst::DeclareFunctionStatement& functionNode);
UInt32 GetConstantId(const ShaderAst::ConstantValue& value) const;
UInt32 GetExtendedInstructionSet(const std::string& instructionSetName) const;
UInt32 GetExtVarPointerId(std::size_t varIndex) const;
UInt32 GetFunctionTypeId(const ShaderAst::DeclareFunctionStatement& functionNode);
UInt32 GetPointerTypeId(const ShaderAst::ExpressionType& type, SpirvStorageClass storageClass) const;