diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-10-18 06:26:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-17 15:26:00 -0700 |
| commit | 7826afcaad78cc33c976bb3db3cdc9eada4c77e8 (patch) | |
| tree | 7a89a54512a4cbab6165d2c4b7906f88a032bbee /slang.h | |
| parent | 0a3683dd39fc04d15937b8a4700d477f9492c257 (diff) | |
Type layouts for structured buffers with counters (#3269)
* More tests for append structured buffer
* Append and Consume structured buffer tests for DX12
* neaten
* test wobble
* Add counter layout information to append/consume structured buffers
* add getRWStructuredBufferType
* Correct definition of get size for append/consume structured buffers
* tweak append structured buffer test
* Allow initializing counter buffer in render test
* vulkan test for consume structured buffer
* Handle null counterVarLayout in getExplicitCounterBindingRangeOffset
* remove dead code
* Implement atomic counter increment/decrement for spirv
* explicit spirv test
* Add missing check on result
* Hold on to counter resources
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'slang.h')
| -rw-r--r-- | slang.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -2227,6 +2227,8 @@ extern "C" SLANG_API SlangInt spReflectionTypeLayout_findFieldIndexByName(SlangReflectionTypeLayout* typeLayout, const char* nameBegin, const char* nameEnd); + SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_GetExplicitCounter(SlangReflectionTypeLayout* typeLayout); + SLANG_API size_t spReflectionTypeLayout_GetElementStride(SlangReflectionTypeLayout* type, SlangParameterCategory category); SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_GetElementTypeLayout(SlangReflectionTypeLayout* type); SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_GetElementVarLayout(SlangReflectionTypeLayout* type); @@ -2253,6 +2255,7 @@ extern "C" SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_getBindingRangeLeafTypeLayout(SlangReflectionTypeLayout* typeLayout, SlangInt index); SLANG_API SlangReflectionVariable* spReflectionTypeLayout_getBindingRangeLeafVariable(SlangReflectionTypeLayout* typeLayout, SlangInt index); SLANG_API SlangInt spReflectionTypeLayout_getFieldBindingRangeOffset(SlangReflectionTypeLayout* typeLayout, SlangInt fieldIndex); + SLANG_API SlangInt spReflectionTypeLayout_getExplicitCounterBindingRangeOffset(SlangReflectionTypeLayout* inTypeLayout); SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeDescriptorSetIndex(SlangReflectionTypeLayout* typeLayout, SlangInt index); SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeFirstDescriptorRangeIndex(SlangReflectionTypeLayout* typeLayout, SlangInt index); @@ -2711,6 +2714,11 @@ namespace slang return spReflectionTypeLayout_findFieldIndexByName((SlangReflectionTypeLayout*) this, nameBegin, nameEnd); } + VariableLayoutReflection* getExplicitCounter() + { + return (VariableLayoutReflection*) spReflectionTypeLayout_GetExplicitCounter((SlangReflectionTypeLayout*) this); + } + bool isArray() { return getType()->isArray(); } TypeLayoutReflection* unwrapArray() @@ -2871,6 +2879,12 @@ namespace slang fieldIndex); } + SlangInt getExplicitCounterBindingRangeOffset() + { + return spReflectionTypeLayout_getExplicitCounterBindingRangeOffset( + (SlangReflectionTypeLayout*) this); + } + TypeLayoutReflection* getBindingRangeLeafTypeLayout(SlangInt index) { return (TypeLayoutReflection*) spReflectionTypeLayout_getBindingRangeLeafTypeLayout( |
