diff options
| author | Yong He <yonghe@outlook.com> | 2021-04-29 14:19:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-29 14:19:51 -0700 |
| commit | 2482271fffbe85efc1bd7efcf74a76f6ed436012 (patch) | |
| tree | 707da083c8eda527b7c548d636cb884cf53c53eb /tools/gfx/d3d12/render-d3d12.cpp | |
| parent | ad6f3070251f25cf022c231b8567d78e98061127 (diff) | |
`gfx` DebugCallback and debug layer. (#1822)
* `gfx` DebugCallback and debug layer.
Diffstat (limited to 'tools/gfx/d3d12/render-d3d12.cpp')
| -rw-r--r-- | tools/gfx/d3d12/render-d3d12.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/gfx/d3d12/render-d3d12.cpp b/tools/gfx/d3d12/render-d3d12.cpp index a752222d6..8cb9ce197 100644 --- a/tools/gfx/d3d12/render-d3d12.cpp +++ b/tools/gfx/d3d12/render-d3d12.cpp @@ -3849,7 +3849,6 @@ Result D3D12Device::initialize(const Desc& desc) debug1->SetEnableGPUBasedValidation(true); } #endif - m_dxDebug->EnableDebugLayer(); } } @@ -4824,8 +4823,10 @@ Result D3D12Device::createProgram(const IShaderProgram::Desc& desc, IShaderProgr (SlangInt)i, 0, kernelCode.writeRef(), diagnostics.writeRef()); if (diagnostics) { - printf("%s\n", (char*)diagnostics->getBufferPointer()); - // TODO: report compile error. + getDebugCallback()->handleMessage( + compileResult == SLANG_OK ? DebugMessageType::Warning : DebugMessageType::Error, + DebugMessageSource::Slang, + (char*)diagnostics->getBufferPointer()); } SLANG_RETURN_ON_FAIL(compileResult); List<uint8_t>* shaderCodeDestBuffer = nullptr; |
