From 44c0a56974b664e50b2cb8cb6f10740b19c4e02f Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 3 Dec 2020 08:23:05 -0800 Subject: 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 --- source/slang/slang-type-layout.h | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'source/slang/slang-type-layout.h') 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 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 descriptorRanges; + }; + + struct BindingRangeInfo + { + TypeLayout* leafTypeLayout; + SlangBindingType bindingType; + LayoutSize count; + Int descriptorSetIndex; + Int firstDescriptorRangeIndex; + Int descriptorRangeCount; + }; + + struct SubObjectRangeInfo + { + Int bindingRangeIndex; + }; + + List> m_descriptorSets; + List m_bindingRanges; + List m_subObjectRanges; + }; + + RefPtr m_extendedInfo; }; typedef unsigned int VarLayoutFlags; @@ -495,6 +535,12 @@ public: void removeResourceUsage(LayoutResourceKind kind); RefPtr 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 -- cgit v1.2.3