diff options
| author | Yong He <yonghe@outlook.com> | 2022-02-10 11:50:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-10 11:50:07 -0800 |
| commit | 0c04885da9edc3df7a1ef5cb520be1bd29eb13e4 (patch) | |
| tree | 401c9220c3dcf23e4698405e00fe3b5176e0e472 /source | |
| parent | 15f07d14b5f048dc355536cbdf5cf9c10291b13b (diff) | |
gfx: support d3d12 root parameters (#2122)
* Various fixes to gfx.
* Fix.
* Fixes.
* Fix.
* gfx: support root parameter via user-defined attribute.
* Fix.
* Fix.
* Skip d3d12 tests on win x86.
* Fixes.
Co-authored-by: Yong He <yhe@nvidia.com>
Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 21 | ||||
| -rw-r--r-- | source/slang/slang-type-layout.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index 714dc292f..8bcab8ada 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -1559,6 +1559,7 @@ namespace Slang TypeLayout::ExtendedInfo::BindingRangeInfo bindingRange; bindingRange.leafTypeLayout = typeLayout; + bindingRange.variable = path.primary ? path.primary->var->getVariable() : nullptr; bindingRange.bindingType = bindingType; bindingRange.count = multiplier; bindingRange.descriptorSetIndex = -1; @@ -1745,6 +1746,7 @@ namespace Slang // TypeLayout::ExtendedInfo::BindingRangeInfo bindingRange; bindingRange.leafTypeLayout = typeLayout; + bindingRange.variable = path.primary ? path.primary->var->getVariable() : nullptr; bindingRange.bindingType = SLANG_BINDING_TYPE_EXISTENTIAL_VALUE; bindingRange.count = multiplier; bindingRange.descriptorSetIndex = 0; @@ -1817,6 +1819,7 @@ namespace Slang // TypeLayout::ExtendedInfo::BindingRangeInfo bindingRange; bindingRange.leafTypeLayout = typeLayout; + bindingRange.variable = path.primary ? path.primary->var->getVariable() : nullptr; bindingRange.bindingType = bindingType; bindingRange.count = multiplier; bindingRange.descriptorSetIndex = 0; @@ -2016,6 +2019,24 @@ SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_getBindingRangeLeafT return convert(bindingRange.leafTypeLayout); } +SLANG_API SlangReflectionVariable* spReflectionTypeLayout_getBindingRangeVariable( + SlangReflectionTypeLayout* inTypeLayout, SlangInt index) +{ + auto typeLayout = convert(inTypeLayout); + if (!typeLayout) + return 0; + + auto extTypeLayout = Slang::getExtendedTypeLayout(typeLayout); + if (index < 0) + return 0; + if (index >= extTypeLayout->m_bindingRanges.getCount()) + return 0; + auto& bindingRange = extTypeLayout->m_bindingRanges[index]; + + return convert(bindingRange.variable); +} + + SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeDescriptorSetIndex(SlangReflectionTypeLayout* inTypeLayout, SlangInt index) { auto typeLayout = convert(inTypeLayout); diff --git a/source/slang/slang-type-layout.h b/source/slang/slang-type-layout.h index 82d333fa9..d66a77365 100644 --- a/source/slang/slang-type-layout.h +++ b/source/slang/slang-type-layout.h @@ -431,6 +431,7 @@ public: struct BindingRangeInfo { + VarDeclBase* variable; TypeLayout* leafTypeLayout; SlangBindingType bindingType; LayoutSize count; |
