summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-cpp.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-01-17 14:37:27 -0800
committerGitHub <noreply@github.com>2025-01-17 14:37:27 -0800
commitfc77070fdc9bfa599e8d66b21743778de3011e53 (patch)
treea9a0983bd704b0e760ae94d5330a74bc72f1154f /source/slang/slang-emit-cpp.cpp
parent3ff257816fc8f376d9bee76378a690757f8b5377 (diff)
Refactor _Texture to constrain on texel types. (#6115)
* Refactor _Texture to constrain on texel types. * Fix tests. * Fix. * Disable glsl texture test because rhi can't run it correctly.
Diffstat (limited to 'source/slang/slang-emit-cpp.cpp')
-rw-r--r--source/slang/slang-emit-cpp.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp
index b0d1fbb4c..13a85e8ab 100644
--- a/source/slang/slang-emit-cpp.cpp
+++ b/source/slang/slang-emit-cpp.cpp
@@ -614,7 +614,10 @@ void CPPSourceEmitter::emitGlobalRTTISymbolPrefix()
void CPPSourceEmitter::emitWitnessTable(IRWitnessTable* witnessTable)
{
- auto interfaceType = cast<IRInterfaceType>(witnessTable->getConformanceType());
+ auto interfaceType = as<IRInterfaceType>(witnessTable->getConformanceType());
+
+ if (!interfaceType)
+ return;
// Ignore witness tables for builtin interface types.
if (isBuiltin(interfaceType))