summaryrefslogtreecommitdiffstats
path: root/slang.h
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-10-18 06:26:00 +0800
committerGitHub <noreply@github.com>2023-10-17 15:26:00 -0700
commit7826afcaad78cc33c976bb3db3cdc9eada4c77e8 (patch)
tree7a89a54512a4cbab6165d2c4b7906f88a032bbee /slang.h
parent0a3683dd39fc04d15937b8a4700d477f9492c257 (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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/slang.h b/slang.h
index 78b56c546..fab62cf81 100644
--- a/slang.h
+++ b/slang.h
@@ -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(