From 858c7c57b125afed9b5b2329d6b02477284e4803 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 17 Aug 2021 09:39:02 -0700 Subject: Add GLSL450 intrinsics to SPIRV direct emit. (#1921) * Add GLSL450 intrinsics to SPIRV direct emit. * Fix. * Fix compiler error. * Fix. * Fix compiler error. * Make direct-spirv tests actually run. --- source/slang/slang-emit-base.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/slang/slang-emit-base.cpp') diff --git a/source/slang/slang-emit-base.cpp b/source/slang/slang-emit-base.cpp index d00b723ab..0f1c54e70 100644 --- a/source/slang/slang-emit-base.cpp +++ b/source/slang/slang-emit-base.cpp @@ -52,4 +52,25 @@ IRVarLayout* SourceEmitterBase::getVarLayout(IRInst* var) return as(decoration->getLayout()); } +BaseType SourceEmitterBase::extractBaseType(IRType* inType) +{ + auto type = inType; + for (;;) + { + if (auto irBaseType = as(type)) + { + return irBaseType->getBaseType(); + } + else if (auto vecType = as(type)) + { + type = vecType->getElementType(); + continue; + } + else + { + return BaseType::Void; + } + } +} + } -- cgit v1.2.3