mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
d3d12device: Print live objects on finalize()
The report from debug layer can help tracing resource leak Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
This commit is contained in:
parent
6fa41f78bb
commit
2c3f3c0cb6
1 changed files with 38 additions and 0 deletions
|
@ -83,6 +83,44 @@ struct _GstD3D12DevicePrivate
|
|||
|
||||
gst_clear_object (©_ca_pool);
|
||||
gst_clear_object (©_cl_pool);
|
||||
|
||||
factory = nullptr;
|
||||
adapter = nullptr;
|
||||
d3d11on12 = nullptr;
|
||||
|
||||
if (info_queue && device) {
|
||||
ComPtr <ID3D12DebugDevice> debug_dev;
|
||||
device.As (&debug_dev);
|
||||
if (debug_dev) {
|
||||
debug_dev->ReportLiveDeviceObjects (D3D12_RLDO_DETAIL |
|
||||
D3D12_RLDO_IGNORE_INTERNAL);
|
||||
|
||||
UINT64 num_msg = info_queue->GetNumStoredMessages ();
|
||||
for (UINT64 i = 0; i < num_msg; i++) {
|
||||
HRESULT hr;
|
||||
SIZE_T msg_len;
|
||||
D3D12_MESSAGE *msg;
|
||||
|
||||
hr = info_queue->GetMessage (i, nullptr, &msg_len);
|
||||
if (FAILED (hr) || msg_len == 0)
|
||||
continue;
|
||||
|
||||
msg = (D3D12_MESSAGE *) g_malloc0 (msg_len);
|
||||
hr = info_queue->GetMessage (i, msg, &msg_len);
|
||||
if (FAILED (hr) || msg_len == 0) {
|
||||
g_free (msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
gst_debug_log (gst_d3d12_sdk_debug, GST_LEVEL_INFO,
|
||||
__FILE__, GST_FUNCTION, __LINE__, nullptr,
|
||||
"D3D12InfoQueue: %s", msg->pDescription);
|
||||
g_free (msg);
|
||||
}
|
||||
|
||||
info_queue->ClearStoredMessages ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ComPtr<ID3D12Device> device;
|
||||
|
|
Loading…
Reference in a new issue