summaryrefslogtreecommitdiff
path: root/source/slang/slang-type-layout.cpp
diff options
context:
space:
mode:
authorJulius Ikkala <julius.ikkala@gmail.com>2025-10-16 21:53:10 +0300
committerGitHub <noreply@github.com>2025-10-16 18:53:10 +0000
commit537697d3aa21b418c348b1017005603668b6a4cb (patch)
tree4ad71cfe4ab2c51f2071d8171ba7bd98929a776a /source/slang/slang-type-layout.cpp
parent0257cb001b6f5c31e4ac0435d546fe638a17c48a (diff)
Inline global constants for shader style CPU targets (#8686)
On the shader-host-callable target, test `gh-4874.slang` generates IR that contains global constants referencing global params. These need to get inlined into functions, as otherwise `introduceExplicitGlobalContext()` will fail with "no outer func at use site for global", making the test crash the compiler.
Diffstat (limited to 'source/slang/slang-type-layout.cpp')
-rw-r--r--source/slang/slang-type-layout.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp
index 5bbcd2eb1..2daf33fdf 100644
--- a/source/slang/slang-type-layout.cpp
+++ b/source/slang/slang-type-layout.cpp
@@ -2712,6 +2712,12 @@ bool isWGPUTarget(TargetRequest* targetReq)
return isWGPUTarget(targetReq->getTarget());
}
+bool isKernelTarget(CodeGenTarget codeGenTarget)
+{
+ return ArtifactDescUtil::makeDescForCompileTarget(asExternal(codeGenTarget)).style ==
+ ArtifactStyle::Kernel;
+}
+
SourceLanguage getIntermediateSourceLanguageForTarget(TargetProgram* targetProgram)
{
// If we are emitting directly, there is no intermediate source language