summaryrefslogtreecommitdiffstats
path: root/tools/gfx/render.cpp
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2023-01-25 17:48:55 +0100
committerGitHub <noreply@github.com>2023-01-25 08:48:55 -0800
commitae11538f5d667b11d3b3191a827093f3727eed1b (patch)
tree2670eaad8f6f46484f995ecb28b10883c412c3ea /tools/gfx/render.cpp
parent951ad25e0a9c3b0089c6b996b8e821ac93cf5766 (diff)
GFX report live objects (#2609)
* Add utility to call D3D ReportLiveObjects * Add gfxReportLiveObjects API call * Only warn on swapchain image references
Diffstat (limited to 'tools/gfx/render.cpp')
-rw-r--r--tools/gfx/render.cpp11
1 files changed, 11 insertions, 0 deletions
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<AdapterInfo>& outAdapters);
Result SLANG_MCALL getVKAdapters(List<AdapterInfo>& outAdapters);
Result SLANG_MCALL getCUDAAdapters(List<AdapterInfo>& 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;