summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-07-30 20:28:34 -0700
committerGitHub <noreply@github.com>2024-07-30 20:28:34 -0700
commit6e4b82741893be55f6216c31e19650029c667078 (patch)
treefefd4529c6066763653732d7f93ca5cf07027a76 /source/slang/slang-emit.cpp
parent04e7327a2067c82db3eaef51955f211e148ac933 (diff)
Fixes for Metal ParameterBlock support. (#4752)
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index a8ed469fa..044f79531 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -15,6 +15,7 @@
#include "slang-ir-dce.h"
#include "slang-ir-diff-call.h"
#include "slang-ir-check-recursive-type.h"
+#include "slang-ir-check-shader-parameter-type.h"
#include "slang-ir-autodiff.h"
#include "slang-ir-defunctionalization.h"
#include "slang-ir-dll-export.h"
@@ -739,8 +740,15 @@ Result linkAndOptimizeIR(
}
if (targetProgram->getOptionSet().shouldRunNonEssentialValidation())
+ {
checkForRecursiveTypes(irModule, sink);
+ // For some targets, we are more restrictive about what types are allowed
+ // to be used as shader parameters in ConstantBuffer/ParameterBlock.
+ // We will check for these restrictions here.
+ checkForInvalidShaderParameterType(targetRequest, irModule, sink);
+ }
+
if (sink->getErrorCount() != 0)
return SLANG_FAIL;