diff options
| author | Yong He <yonghe@outlook.com> | 2024-07-19 11:49:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-19 11:49:42 -0700 |
| commit | f114433debfba67cbe1db239b6e92278d41ed438 (patch) | |
| tree | 3a8ff78deb657d203c87bd22bc2ee83575e834f6 /source/slang/slang-compiler.h | |
| parent | adf758c8c4032afcd96d995840bd697d2adef34c (diff) | |
Support parameter block in metal shader objects. (#4671)
* Support parameter block in metal shader objects.
* Ingore parameter block tests on devices without tier2 argument buffer.
* Fix warning.
* Fix texture subscript test.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-compiler.h')
| -rwxr-xr-x | source/slang/slang-compiler.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h index 7fc43d778..4bae6c10d 100755 --- a/source/slang/slang-compiler.h +++ b/source/slang/slang-compiler.h @@ -1787,11 +1787,27 @@ namespace Slang CodeGenTarget getTarget() { return optionSet.getEnumOption<CodeGenTarget>(CompilerOptionName::Target); } // TypeLayouts created on the fly by reflection API - Dictionary<Type*, RefPtr<TypeLayout>> typeLayouts; + struct TypeLayoutKey + { + Type* type; + slang::LayoutRules rules; + HashCode getHashCode() const + { + Hasher hasher; + hasher.hashValue(type); + hasher.hashValue(rules); + return hasher.getResult(); + } + bool operator==(TypeLayoutKey other) const + { + return type == other.type && rules == other.rules; + } + }; + Dictionary<TypeLayoutKey, RefPtr<TypeLayout>> typeLayouts; - Dictionary<Type*, RefPtr<TypeLayout>>& getTypeLayouts() { return typeLayouts; } + Dictionary<TypeLayoutKey, RefPtr<TypeLayout>>& getTypeLayouts() { return typeLayouts; } - TypeLayout* getTypeLayout(Type* type); + TypeLayout* getTypeLayout(Type* type, slang::LayoutRules rules); CompilerOptionSet& getOptionSet() { return optionSet; } |
