diff options
| author | Yong He <yonghe@outlook.com> | 2024-06-11 12:31:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-11 12:31:37 -0700 |
| commit | 6909d65c77bb4e7c9cfb281bd1684a58d5f8b94d (patch) | |
| tree | 396a628b7fda779dcc6e820e86d44e29d0c7be95 /source/slang/slang-compiler.cpp | |
| parent | ef20d9309674dc8c25a9798d95138cf739299928 (diff) | |
SPIRV backend: add support for tessellation stages, (#4336)
Diffstat (limited to 'source/slang/slang-compiler.cpp')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 0277bb092..ed208ca37 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -2536,12 +2536,27 @@ namespace Slang if (allTargetsCUDARelated && targets.getCount() > 0) continue; - auto numThreadsAttr = funcDecl->findModifier<NumThreadsAttribute>(); - if (numThreadsAttr) - profile.setStage(Stage::Compute); - else + bool canDetermineStage = false; + for (auto modifier : funcDecl->modifiers) + { + if (as<NumThreadsAttribute>(modifier)) + { + if (funcDecl->findModifier<OutputTopologyAttribute>()) + profile.setStage(Stage::Mesh); + else + profile.setStage(Stage::Compute); + canDetermineStage = true; + break; + } + else if (as<PatchConstantFuncAttribute>(modifier)) + { + profile.setStage(Stage::Hull); + canDetermineStage = true; + break; + } + } + if (!canDetermineStage) continue; - } RefPtr<EntryPoint> entryPoint = EntryPoint::create( |
