summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-explicit-global-context.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-ir-explicit-global-context.cpp b/source/slang/slang-ir-explicit-global-context.cpp
index 68f23461b..8f11bce2c 100644
--- a/source/slang/slang-ir-explicit-global-context.cpp
+++ b/source/slang/slang-ir-explicit-global-context.cpp
@@ -270,6 +270,15 @@ struct IntroduceExplicitGlobalContextPass
//
globalUniformsParam->insertBefore(firstOrdinary);
}
+ else
+ {
+ // The nature of our current ABI for entry points on CPU/CUDA
+ // means that we need an explicit parameter to be *declared*
+ // for the global uniforms, even if it is never used.
+ //
+ auto placeholderParam = builder.createParam(builder.getRawPointerType());
+ placeholderParam->insertBefore(firstOrdinary);
+ }
// The `KernelContext` to use inside the entry point
// will be a local variable declared in the first block.