summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-parameter-binding.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-11 12:31:37 -0700
committerGitHub <noreply@github.com>2024-06-11 12:31:37 -0700
commit6909d65c77bb4e7c9cfb281bd1684a58d5f8b94d (patch)
tree396a628b7fda779dcc6e820e86d44e29d0c7be95 /source/slang/slang-parameter-binding.cpp
parentef20d9309674dc8c25a9798d95138cf739299928 (diff)
SPIRV backend: add support for tessellation stages, (#4336)
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
-rw-r--r--source/slang/slang-parameter-binding.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp
index 56c85e9cb..cfbd7f2c5 100644
--- a/source/slang/slang-parameter-binding.cpp
+++ b/source/slang/slang-parameter-binding.cpp
@@ -2092,6 +2092,23 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter(
return arrayTypeLayout;
}
+ else if (auto patchType = as<HLSLPatchType>(type))
+ {
+ // Similar to the MeshOutput case, a `InputPatch` or `OutputPatch` type is just like an array.
+ //
+ auto elementTypeLayout = processEntryPointVaryingParameter(context, patchType->getElementType(), state, varLayout);
+
+ RefPtr<ArrayTypeLayout> arrayTypeLayout = new ArrayTypeLayout();
+ arrayTypeLayout->elementTypeLayout = elementTypeLayout;
+ arrayTypeLayout->type = arrayType;
+
+ for (auto rr : elementTypeLayout->resourceInfos)
+ {
+ arrayTypeLayout->findOrAddResourceInfo(rr.kind)->count = rr.count;
+ }
+
+ return arrayTypeLayout;
+ }
// Ignore a bunch of types that don't make sense here...
else if (const auto subpassType = as<SubpassInputType>(type)) { return nullptr; }
else if (const auto textureType = as<TextureType>(type)) { return nullptr; }