summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorGangzheng Tong <tonggangzheng@gmail.com>2025-04-09 14:41:41 -0700
committerGitHub <noreply@github.com>2025-04-09 14:41:41 -0700
commit17d1a2c8c3ff6b357b99faaefff7caa7200be2f8 (patch)
tree44bd5d93e7d8f080ba47e73f7a5bd5dd7dc61fa3 /source
parentfd09feaaa19c1ae3441dd687bced1b12ff7c768e (diff)
Get real value for typeAdapter (#6762)
* Get real value for typeAdapter When the type is mismatch and typeAdapter is used, get the real value from typeAdapter so that we don't get nullptr for irValue. This fixes the assert if uint is used for SV_VertexID, which is an int in the system binding semantic. Fixes: #6525 * Add test case; add nullptr check
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-glsl-legalize.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-ir-glsl-legalize.cpp b/source/slang/slang-ir-glsl-legalize.cpp
index 455c924ca..802fc1eb4 100644
--- a/source/slang/slang-ir-glsl-legalize.cpp
+++ b/source/slang/slang-ir-glsl-legalize.cpp
@@ -3541,6 +3541,15 @@ void legalizeEntryPointParameterForGLSL(
if (elem.key == key)
{
realGlobalVar = elem.val.irValue;
+ if (!realGlobalVar &&
+ ScalarizedVal::Flavor::typeAdapter == elem.val.flavor)
+ {
+ if (auto typeAdapterVal =
+ as<ScalarizedTypeAdapterValImpl>(elem.val.impl))
+ {
+ realGlobalVar = typeAdapterVal->val.irValue;
+ }
+ }
break;
}
}