From ae11538f5d667b11d3b3191a827093f3727eed1b Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Wed, 25 Jan 2023 17:48:55 +0100 Subject: GFX report live objects (#2609) * Add utility to call D3D ReportLiveObjects * Add gfxReportLiveObjects API call * Only warn on swapchain image references --- tools/gfx/render.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/gfx/render.cpp') diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp index 84f537705..048eb8224 100644 --- a/tools/gfx/render.cpp +++ b/tools/gfx/render.cpp @@ -21,6 +21,8 @@ Result SLANG_MCALL getD3D12Adapters(List& outAdapters); Result SLANG_MCALL getVKAdapters(List& outAdapters); Result SLANG_MCALL getCUDAAdapters(List& outAdapters); +Result SLANG_MCALL reportD3DLiveObjects(); + static bool debugLayerEnabled = false; bool isGfxDebugLayerEnabled() { return debugLayerEnabled; } @@ -364,6 +366,15 @@ extern "C" return resultCode; } + SLANG_GFX_API SlangResult SLANG_MCALL + gfxReportLiveObjects() + { +#if SLANG_WINDOWS_FAMILY + SLANG_RETURN_ON_FAIL(reportD3DLiveObjects()); +#endif + return SLANG_OK; + } + SLANG_GFX_API SlangResult SLANG_MCALL gfxSetDebugCallback(IDebugCallback* callback) { _getDebugCallback() = callback; -- cgit v1.2.3