From 7f8a9994d0bd99a171a1daa0bce46d92c02ccffd Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 21 May 2021 16:38:33 -0700 Subject: [gfx] Support StructuredBuffer. (#1851) Co-authored-by: T. Foley --- source/slang/slang-compiler.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'source/slang/slang-compiler.h') diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h index 54c61bd75..603ee0bb5 100755 --- a/source/slang/slang-compiler.h +++ b/source/slang/slang-compiler.h @@ -1199,14 +1199,10 @@ namespace Slang // TypeLayouts created on the fly by reflection API Dictionary> typeLayouts; - Dictionary parameterBlockTypes; - Dictionary>& getTypeLayouts() { return typeLayouts; } TypeLayout* getTypeLayout(Type* type); - TypeLayout* getParameterBlockLayout(Type* type); - private: Linkage* linkage = nullptr; CodeGenTarget format = CodeGenTarget::Unknown; @@ -1251,6 +1247,21 @@ namespace Slang const char* getBuildTagString(); struct TypeCheckingCache; + + struct ContainerTypeKey + { + slang::TypeReflection* elementType; + slang::ContainerType containerType; + bool operator==(ContainerTypeKey other) + { + return elementType == other.elementType && containerType == other.containerType; + } + Slang::HashCode getHashCode() + { + return Slang::combineHash( + Slang::getHashCode(elementType), Slang::getHashCode(containerType)); + } + }; /// A context for loading and re-using code modules. class Linkage : public RefObject, public slang::ISession @@ -1279,11 +1290,11 @@ namespace Slang SlangInt targetIndex = 0, slang::LayoutRules rules = slang::LayoutRules::Default, ISlangBlob** outDiagnostics = nullptr) override; - SLANG_NO_THROW slang::TypeLayoutReflection* SLANG_MCALL getParameterBlockLayout( + SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL getContainerType( slang::TypeReflection* elementType, - SlangInt targetIndex = 0, - slang::LayoutRules rules = slang::LayoutRules::Default, + slang::ContainerType containerType, ISlangBlob** outDiagnostics = nullptr) override; + SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL getDynamicType() override; SLANG_NO_THROW SlangResult SLANG_MCALL getTypeRTTIMangledName( slang::TypeReflection* type, ISlangBlob** outNameBlob) override; @@ -1348,6 +1359,9 @@ namespace Slang RefPtr m_astBuilder; + // Cache for container types. + Dictionary m_containerTypes; + // cache used by type checking, implemented in check.cpp TypeCheckingCache* getTypeCheckingCache(); void destroyTypeCheckingCache(); -- cgit v1.2.3