Commit 289e1cee authored by Laszlo Agocs's avatar Laszlo Agocs

d3d: A little internal tooling for findings leaks

parent 7cb1bedb
......@@ -294,7 +294,11 @@ void QRhiD3D11::destroy()
rsh->d_d3d11.context = nullptr;
}
if (rsh->d_d3d11.dev) {
reinterpret_cast<ID3D11Device *>(rsh->d_d3d11.dev)->Release();
ID3D11Device *rshDev = reinterpret_cast<ID3D11Device *>(rsh->d_d3d11.dev);
#if 0
reportLiveObjects(rshDev); // "Refcount" > 0 means that object was not released correctly
#endif
rshDev->Release();
rsh->d_d3d11.dev = nullptr;
}
}
......@@ -306,6 +310,16 @@ void QRhiD3D11::destroy()
}
}
void QRhiD3D11::reportLiveObjects(ID3D11Device *device)
{
// this works only when params.enableDebugLayer was true
ID3D11Debug *debug;
if (SUCCEEDED(device->QueryInterface(IID_ID3D11Debug, reinterpret_cast<void **>(&debug)))) {
debug->ReportLiveDeviceObjects(D3D11_RLDO_DETAIL);
debug->Release();
}
}
QVector<int> QRhiD3D11::supportedSampleCounts() const
{
return { 1, 2, 4, 8 };
......
......@@ -530,6 +530,7 @@ public:
void executeCommandBuffer(QD3D11CommandBuffer *cbD, QD3D11SwapChain *timestampSwapChain = nullptr);
DXGI_SAMPLE_DESC effectiveSampleCount(int sampleCount) const;
void finishActiveReadbacks();
void reportLiveObjects(ID3D11Device *device);
QRhiResourceSharingHostPrivate *rsh = nullptr;
bool debugLayer = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment