1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxgi] Store device pointer in DxgiSwapChainDispatcher

This commit is contained in:
Paul Gofman 2022-10-20 09:12:29 -05:00 committed by Philip Rebohle
parent 53a0c3726c
commit e311f25287
2 changed files with 8 additions and 3 deletions

View File

@ -177,7 +177,7 @@ namespace dxvk {
}
// Wrap object in swap chain dispatcher
*ppSwapChain = new DxgiSwapChainDispatcher(frontendSwapChain.ref());
*ppSwapChain = new DxgiSwapChainDispatcher(frontendSwapChain.ref(), pDevice);
return S_OK;
}

View File

@ -8,8 +8,9 @@ namespace dxvk {
public:
DxgiSwapChainDispatcher(IDXGISwapChain4* dispatch)
: m_dispatch(dispatch) {
DxgiSwapChainDispatcher(IDXGISwapChain4* dispatch, IUnknown* device)
: m_device(device),
m_dispatch(dispatch) {
}
virtual ~DxgiSwapChainDispatcher() {
@ -296,6 +297,10 @@ namespace dxvk {
private:
// m_device is not used or reference counted, provided for compatibility with mod engines
// which expect to find device pointer in the memory after swapchain interface.
IUnknown* m_device;
IDXGISwapChain4* m_dispatch;
};