1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d11] Fixed yet another ref counting bug

This commit is contained in:
Philip Rebohle 2017-12-11 17:01:38 +01:00
parent c3a29e9de0
commit 037e9a643d
7 changed files with 25 additions and 10 deletions

View File

@ -72,8 +72,6 @@ namespace dxvk {
// Set up logic op state as well
ctx->setLogicOpState(m_loState);
// TODO set blend factor
}

View File

@ -47,6 +47,16 @@ namespace dxvk {
}
ULONG D3D11DeviceContext::AddRef() {
return m_parent->AddRef();
}
ULONG D3D11DeviceContext::Release() {
return m_parent->Release();
}
HRESULT D3D11DeviceContext::QueryInterface(
REFIID riid,
void** ppvObject) {
@ -815,6 +825,7 @@ namespace dxvk {
ID3D11HullShader* pHullShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
if (m_state.hs.shader.ptr() != pHullShader)
Logger::err("D3D11DeviceContext::HSSetShader: Not implemented");
}
@ -879,6 +890,7 @@ namespace dxvk {
ID3D11DomainShader* pDomainShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
if (m_state.ds.shader.ptr() != pDomainShader)
Logger::err("D3D11DeviceContext::DSSetShader: Not implemented");
}
@ -943,6 +955,7 @@ namespace dxvk {
ID3D11GeometryShader* pShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
if (m_state.gs.shader.ptr() != pShader)
Logger::err("D3D11DeviceContext::GSSetShader: Not implemented");
}

View File

@ -20,6 +20,10 @@ namespace dxvk {
Rc<DxvkDevice> device);
~D3D11DeviceContext();
ULONG AddRef() final;
ULONG Release() final;
HRESULT QueryInterface(
REFIID riid,
void** ppvObject) final;

View File

@ -40,6 +40,7 @@ namespace dxvk {
D3D11Device::~D3D11Device() {
m_presentDevice->SetDeviceLayer(nullptr);
m_dxgiDevice->SetDeviceLayer(nullptr);
delete m_context;
}
@ -1092,7 +1093,7 @@ namespace dxvk {
void D3D11Device::GetImmediateContext(ID3D11DeviceContext** ppImmediateContext) {
*ppImmediateContext = m_context.ref();
*ppImmediateContext = ref(m_context);
}

View File

@ -10,7 +10,6 @@
#include "../util/com/com_private_data.h"
namespace dxvk {
class DxgiAdapter;
class D3D11DeviceContext;
class D3D11PresentDevice;
@ -243,7 +242,7 @@ namespace dxvk {
const Rc<DxvkDevice> m_dxvkDevice;
const Rc<DxvkAdapter> m_dxvkAdapter;
Com<ID3D11DeviceContext> m_context;
D3D11DeviceContext* m_context = nullptr;
std::mutex m_resourceInitMutex;
Rc<DxvkContext> m_resourceInitContext;

View File

@ -78,7 +78,7 @@ namespace dxvk {
void D3D11RasterizerState::GetDevice(ID3D11Device** ppDevice) {
*ppDevice = m_device;
*ppDevice = ref(m_device);
}

View File

@ -56,7 +56,7 @@ namespace dxvk {
auto pair = m_objects.find(desc);
if (pair != m_objects.end())
return pair->second.ptr();
return pair->second.ref();
Com<T> result = new T(device, desc);
m_objects.insert({ desc, result });