diff options
| author | Yong He <yonghe@outlook.com> | 2020-12-03 08:23:05 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-03 08:23:05 -0800 |
| commit | 44c0a56974b664e50b2cb8cb6f10740b19c4e02f (patch) | |
| tree | d6141003be376bdb2c0037178b649b6b2aae673e /source/slang/slang-type-layout.h | |
| parent | ad5dda9261bae63e32bcb914b109fcb5c92faf25 (diff) | |
Add shader object parameter binding to renderer_test. (#1622)
* Add shader object parameter binding to renderer_test.
* remove multiple-definitions.hlsl
* Fix cuda implementation.
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-type-layout.h')
| -rw-r--r-- | source/slang/slang-type-layout.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source/slang/slang-type-layout.h b/source/slang/slang-type-layout.h index 1849b5736..c4df46fe0 100644 --- a/source/slang/slang-type-layout.h +++ b/source/slang/slang-type-layout.h @@ -405,6 +405,46 @@ public: /// Otherwise, returns this type layout. /// RefPtr<TypeLayout> unwrapArray(); + + + /// Extended information about type layout, used for "flat" reflection API + struct ExtendedInfo : public RefObject + { + struct DescriptorRangeInfo + { + SlangBindingType bindingType; + LayoutResourceKind kind; + LayoutSize count; + Int indexOffset; + }; + + struct DescriptorSetInfo : public RefObject + { + Int spaceOffset; + List<DescriptorRangeInfo> descriptorRanges; + }; + + struct BindingRangeInfo + { + TypeLayout* leafTypeLayout; + SlangBindingType bindingType; + LayoutSize count; + Int descriptorSetIndex; + Int firstDescriptorRangeIndex; + Int descriptorRangeCount; + }; + + struct SubObjectRangeInfo + { + Int bindingRangeIndex; + }; + + List<RefPtr<DescriptorSetInfo>> m_descriptorSets; + List<BindingRangeInfo> m_bindingRanges; + List<SubObjectRangeInfo> m_subObjectRanges; + }; + + RefPtr<ExtendedInfo> m_extendedInfo; }; typedef unsigned int VarLayoutFlags; @@ -495,6 +535,12 @@ public: void removeResourceUsage(LayoutResourceKind kind); RefPtr<VarLayout> pendingVarLayout; + + /// Offset in binding ranges within the parent type + /// + /// Note: only usable when extended layout information has been calculated. + /// + Index bindingRangeOffset = -1; }; // type layout for a variable that has a constant-buffer type |
