From ddb1627985bc7f021525e6c39ebec84c89af7d4a Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 7 Dec 2017 00:55:21 +0100 Subject: [PATCH] [d3d11] D3D11DeviceChild subclasses must not store strong references to their parent device --- src/d3d11/d3d11_buffer.cpp | 2 +- src/d3d11/d3d11_buffer.h | 2 +- src/d3d11/d3d11_shader.h | 6 +++--- src/d3d11/d3d11_state_rs.cpp | 2 +- src/d3d11/d3d11_state_rs.h | 3 +-- src/d3d11/d3d11_texture.cpp | 2 +- src/d3d11/d3d11_texture.h | 2 +- src/d3d11/d3d11_view.cpp | 2 +- src/d3d11/d3d11_view.h | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/d3d11/d3d11_buffer.cpp b/src/d3d11/d3d11_buffer.cpp index 5b8ea4e92..6c6f8bf66 100644 --- a/src/d3d11/d3d11_buffer.cpp +++ b/src/d3d11/d3d11_buffer.cpp @@ -35,7 +35,7 @@ namespace dxvk { void D3D11Buffer::GetDevice(ID3D11Device** ppDevice) { - *ppDevice = m_device.ref(); + *ppDevice = ref(m_device); } diff --git a/src/d3d11/d3d11_buffer.h b/src/d3d11/d3d11_buffer.h index 19d12c642..18c713d2a 100644 --- a/src/d3d11/d3d11_buffer.h +++ b/src/d3d11/d3d11_buffer.h @@ -35,7 +35,7 @@ namespace dxvk { private: - Com m_device; + D3D11Device* const m_device; Com m_resource; D3D11_BUFFER_DESC m_desc; diff --git a/src/d3d11/d3d11_shader.h b/src/d3d11/d3d11_shader.h index e327b06cd..bfda2bcd2 100644 --- a/src/d3d11/d3d11_shader.h +++ b/src/d3d11/d3d11_shader.h @@ -70,7 +70,7 @@ namespace dxvk { } void GetDevice(ID3D11Device **ppDevice) final { - *ppDevice = m_device.ref(); + *ppDevice = ref(m_device); } const D3D11ShaderModule& GetShaderModule() const { @@ -79,8 +79,8 @@ namespace dxvk { private: - Com m_device; - D3D11ShaderModule m_module; + D3D11Device* const m_device; + D3D11ShaderModule m_module; }; diff --git a/src/d3d11/d3d11_state_rs.cpp b/src/d3d11/d3d11_state_rs.cpp index 41acafbcf..e94c8b87e 100644 --- a/src/d3d11/d3d11_state_rs.cpp +++ b/src/d3d11/d3d11_state_rs.cpp @@ -76,7 +76,7 @@ namespace dxvk { void D3D11RasterizerState::GetDevice(ID3D11Device** ppDevice) { - *ppDevice = m_device.ref(); + *ppDevice = ref(m_device); } diff --git a/src/d3d11/d3d11_state_rs.h b/src/d3d11/d3d11_state_rs.h index 8a1ddda91..4ad7c25ae 100644 --- a/src/d3d11/d3d11_state_rs.h +++ b/src/d3d11/d3d11_state_rs.h @@ -35,8 +35,7 @@ namespace dxvk { private: - Com m_device; - + D3D11Device* const m_device; D3D11_RASTERIZER_DESC m_desc; Rc m_state; diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index a33250ff3..0616eb158 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -35,7 +35,7 @@ namespace dxvk { void D3D11Texture2D::GetDevice(ID3D11Device** ppDevice) { - *ppDevice = m_device.ref(); + *ppDevice = ref(m_device); } diff --git a/src/d3d11/d3d11_texture.h b/src/d3d11/d3d11_texture.h index 623542a86..26ba15060 100644 --- a/src/d3d11/d3d11_texture.h +++ b/src/d3d11/d3d11_texture.h @@ -41,7 +41,7 @@ namespace dxvk { private: - Com m_device; + D3D11Device* const m_device; Com m_resource; D3D11_TEXTURE2D_DESC m_desc; diff --git a/src/d3d11/d3d11_view.cpp b/src/d3d11/d3d11_view.cpp index 534089cfd..5f32a96ad 100644 --- a/src/d3d11/d3d11_view.cpp +++ b/src/d3d11/d3d11_view.cpp @@ -33,7 +33,7 @@ namespace dxvk { void D3D11RenderTargetView::GetDevice(ID3D11Device** ppDevice) { - *ppDevice = m_device.ref(); + *ppDevice = ref(m_device); } diff --git a/src/d3d11/d3d11_view.h b/src/d3d11/d3d11_view.h index 0b6bbf7b9..307f4e20f 100644 --- a/src/d3d11/d3d11_view.h +++ b/src/d3d11/d3d11_view.h @@ -36,7 +36,7 @@ namespace dxvk { private: - Com m_device; + D3D11Device* const m_device; Com m_resource; D3D11_RENDER_TARGET_VIEW_DESC m_desc;