summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-compiler.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-04-28 11:42:22 -0700
committerGitHub <noreply@github.com>2025-04-28 11:42:22 -0700
commitc39c29bf4c52a85d7c83cc8b66ae45e265f9e078 (patch)
tree969339828d49d7db92ed9294a17bd34cc021db84 /source/slang/slang-compiler.cpp
parent8f6c6e333c06ae1c3b9f00396563c14a2ae09b4d (diff)
Add Slang Byte Code generation and interpreter. (#6896)
* Add Slang Byte Code generation and interpreter. * Fix compile issues. * format code * More compile fix. * Fix clang issue. * Fix more clang issues. * Another clang fix. * Fix clang issues. * Fix another clang issue. * Fix wasm build. * Update building.md * Fix test-server. * Fix compile error. * Fix bug. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-compiler.cpp')
-rw-r--r--source/slang/slang-compiler.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp
index 8e9b8f430..15f22630c 100644
--- a/source/slang/slang-compiler.cpp
+++ b/source/slang/slang-compiler.cpp
@@ -468,6 +468,8 @@ Stage getStageFromAtom(CapabilityAtom atom)
return Stage::Miss;
case CapabilityAtom::_callable:
return Stage::Callable;
+ case CapabilityAtom::dispatch:
+ return Stage::Dispatch;
default:
SLANG_UNEXPECTED("unknown stage atom");
UNREACHABLE_RETURN(Stage::Unknown);
@@ -1766,6 +1768,8 @@ SlangResult emitSPIRVForEntryPointsDirectly(
CodeGenContext* codeGenContext,
ComPtr<IArtifact>& outArtifact);
+SlangResult emitHostVMCode(CodeGenContext* codeGenContext, ComPtr<IArtifact>& outArtifact);
+
static CodeGenTarget _getIntermediateTarget(CodeGenTarget target)
{
switch (target)
@@ -1835,7 +1839,9 @@ SlangResult CodeGenContext::_emitEntryPoints(ComPtr<IArtifact>& outArtifact)
case CodeGenTarget::WGSLSPIRV:
SLANG_RETURN_ON_FAIL(emitWithDownstreamForEntryPoints(outArtifact));
return SLANG_OK;
-
+ case CodeGenTarget::HostVM:
+ SLANG_RETURN_ON_FAIL(emitHostVMCode(this, outArtifact));
+ return SLANG_OK;
default:
break;
}
@@ -1887,6 +1893,7 @@ SlangResult CodeGenContext::emitEntryPoints(ComPtr<IArtifact>& outArtifact)
case CodeGenTarget::HostExecutable:
case CodeGenTarget::HostSharedLibrary:
case CodeGenTarget::WGSLSPIRVAssembly:
+ case CodeGenTarget::HostVM:
{
SLANG_RETURN_ON_FAIL(_emitEntryPoints(outArtifact));