diff options
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( |
