summaryrefslogtreecommitdiffstats
path: root/tools/gfx/renderer-shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/renderer-shared.cpp')
-rw-r--r--tools/gfx/renderer-shared.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp
index 2a12b777c..99af6e4ff 100644
--- a/tools/gfx/renderer-shared.cpp
+++ b/tools/gfx/renderer-shared.cpp
@@ -21,7 +21,7 @@ const Slang::Guid GfxGUID::IID_ISamplerState = SLANG_UUID_ISamplerState;
const Slang::Guid GfxGUID::IID_IResource = SLANG_UUID_IResource;
const Slang::Guid GfxGUID::IID_IBufferResource = SLANG_UUID_IBufferResource;
const Slang::Guid GfxGUID::IID_ITextureResource = SLANG_UUID_ITextureResource;
-const Slang::Guid GfxGUID::IID_IRenderer = SLANG_UUID_IRenderer;
+const Slang::Guid GfxGUID::IID_IDevice = SLANG_UUID_IDevice;
const Slang::Guid GfxGUID::IID_IShaderObject = SLANG_UUID_IShaderObject;
const Slang::Guid GfxGUID::IID_IRenderPassLayout = SLANG_UUID_IRenderPassLayout;
@@ -223,7 +223,7 @@ void PipelineStateBase::initializeBase(const PipelineStateDesc& inDesc)
IDevice* gfx::RendererBase::getInterface(const Guid& guid)
{
- return (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IRenderer)
+ return (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IDevice)
? static_cast<IDevice*>(this)
: nullptr;
}
@@ -447,5 +447,28 @@ Result RendererBase::maybeSpecializePipeline(
return SLANG_OK;
}
+IDebugCallback*& _getDebugCallback()
+{
+ static IDebugCallback* callback = nullptr;
+ return callback;
+}
+
+class NullDebugCallback : public IDebugCallback
+{
+public:
+ virtual SLANG_NO_THROW void SLANG_MCALL
+ handleMessage(DebugMessageType type, DebugMessageSource source, const char* message) override
+ {
+ SLANG_UNUSED(type);
+ SLANG_UNUSED(source);
+ SLANG_UNUSED(message);
+ }
+};
+IDebugCallback* _getNullDebugCallback()
+{
+ static NullDebugCallback result = {};
+ return &result;
+}
} // namespace gfx
+