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/renderer-shared.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tools/gfx/renderer-shared.h') diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h index ed045c617..9aedc8c74 100644 --- a/tools/gfx/renderer-shared.h +++ b/tools/gfx/renderer-shared.h @@ -25,7 +25,7 @@ struct GfxGUID static const Slang::Guid IID_IBufferResource; static const Slang::Guid IID_ITextureResource; static const Slang::Guid IID_IInputLayout; - static const Slang::Guid IID_IRenderer; + static const Slang::Guid IID_IDevice; static const Slang::Guid IID_IShaderObjectLayout; static const Slang::Guid IID_IShaderObject; static const Slang::Guid IID_IRenderPassLayout; @@ -606,4 +606,18 @@ public: Slang::Dictionary> m_shaderObjectLayoutCache; }; +IDebugCallback*& _getDebugCallback(); +IDebugCallback* _getNullDebugCallback(); +inline IDebugCallback* getDebugCallback() +{ + auto rs = _getDebugCallback(); + if (rs) + { + return rs; + } + else + { + return _getNullDebugCallback(); + } +} } -- cgit v1.2.3