From 2482271fffbe85efc1bd7efcf74a76f6ed436012 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 29 Apr 2021 14:19:51 -0700 Subject: `gfx` DebugCallback and debug layer. (#1822) * `gfx` DebugCallback and debug layer. --- tools/gfx/cuda/render-cuda.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/gfx/cuda/render-cuda.cpp') diff --git a/tools/gfx/cuda/render-cuda.cpp b/tools/gfx/cuda/render-cuda.cpp index 14699915b..a6400789f 100644 --- a/tools/gfx/cuda/render-cuda.cpp +++ b/tools/gfx/cuda/render-cuda.cpp @@ -1883,7 +1883,10 @@ public: (SlangInt)0, 0, kernelCode.writeRef(), diagnostics.writeRef()); if (diagnostics) { - // TODO: report compile error. + getDebugCallback()->handleMessage( + compileResult == SLANG_OK ? DebugMessageType::Warning : DebugMessageType::Error, + DebugMessageSource::Slang, + (char*)diagnostics->getBufferPointer()); } SLANG_RETURN_ON_FAIL(compileResult); -- cgit v1.2.3