From e009e63aa71c562bad67aaf6cf41f91d7fc4470d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 18 Mar 2018 14:57:14 +0100 Subject: [PATCH] [d3d11] Fix sampler state refcount issue We cannot use strong references in state objects that are stored inside a member of the device itself. --- src/d3d11/d3d11_sampler.cpp | 2 +- src/d3d11/d3d11_sampler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d3d11/d3d11_sampler.cpp b/src/d3d11/d3d11_sampler.cpp index 93c881474..f7e363c78 100644 --- a/src/d3d11/d3d11_sampler.cpp +++ b/src/d3d11/d3d11_sampler.cpp @@ -64,7 +64,7 @@ namespace dxvk { void STDMETHODCALLTYPE D3D11SamplerState::GetDevice(ID3D11Device** ppDevice) { - *ppDevice = m_device.ref(); + *ppDevice = ref(m_device); } diff --git a/src/d3d11/d3d11_sampler.h b/src/d3d11/d3d11_sampler.h index 7702b4b73..e1f9cef92 100644 --- a/src/d3d11/d3d11_sampler.h +++ b/src/d3d11/d3d11_sampler.h @@ -38,7 +38,7 @@ namespace dxvk { private: - Com m_device; + D3D11Device* const m_device; D3D11_SAMPLER_DESC m_desc; Rc m_sampler;