summaryrefslogtreecommitdiffstats
path: root/tools/gfx/cpu
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-04-29 14:19:51 -0700
committerGitHub <noreply@github.com>2021-04-29 14:19:51 -0700
commit2482271fffbe85efc1bd7efcf74a76f6ed436012 (patch)
tree707da083c8eda527b7c548d636cb884cf53c53eb /tools/gfx/cpu
parentad6f3070251f25cf022c231b8567d78e98061127 (diff)
`gfx` DebugCallback and debug layer. (#1822)
* `gfx` DebugCallback and debug layer.
Diffstat (limited to 'tools/gfx/cpu')
-rw-r--r--tools/gfx/cpu/render-cpu.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/gfx/cpu/render-cpu.cpp b/tools/gfx/cpu/render-cpu.cpp
index af1641e60..2d7d858c4 100644
--- a/tools/gfx/cpu/render-cpu.cpp
+++ b/tools/gfx/cpu/render-cpu.cpp
@@ -1136,7 +1136,17 @@ private:
auto entryPointObject = m_currentRootObject->getEntryPoint(entryPointIndex);
ComPtr<ISlangSharedLibrary> sharedLibrary;
- program->slangProgram->getEntryPointHostCallable(entryPointIndex, targetIndex, sharedLibrary.writeRef());
+ ComPtr<ISlangBlob> diagnostics;
+ auto compileResult = program->slangProgram->getEntryPointHostCallable(
+ entryPointIndex, targetIndex, sharedLibrary.writeRef(), diagnostics.writeRef());
+ if (diagnostics)
+ {
+ getDebugCallback()->handleMessage(
+ compileResult == SLANG_OK ? DebugMessageType::Warning : DebugMessageType::Error,
+ DebugMessageSource::Slang,
+ (char*)diagnostics->getBufferPointer());
+ }
+ if (SLANG_FAILED(compileResult)) return;
auto func = (slang_prelude::ComputeFunc) sharedLibrary->findSymbolAddressByName(entryPointName);