diff --git a/src/d3d11/d3d11_blend.cpp b/src/d3d11/d3d11_blend.cpp index f866bc101..22ca2a3b0 100644 --- a/src/d3d11/d3d11_blend.cpp +++ b/src/d3d11/d3d11_blend.cpp @@ -72,8 +72,6 @@ namespace dxvk { // Set up logic op state as well ctx->setLogicOpState(m_loState); - - // TODO set blend factor } diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 6b3566ec6..3a9081c8d 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -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,7 +825,8 @@ namespace dxvk { ID3D11HullShader* pHullShader, ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - Logger::err("D3D11DeviceContext::HSSetShader: Not implemented"); + if (m_state.hs.shader.ptr() != pHullShader) + Logger::err("D3D11DeviceContext::HSSetShader: Not implemented"); } @@ -879,7 +890,8 @@ namespace dxvk { ID3D11DomainShader* pDomainShader, ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - Logger::err("D3D11DeviceContext::DSSetShader: Not implemented"); + if (m_state.ds.shader.ptr() != pDomainShader) + Logger::err("D3D11DeviceContext::DSSetShader: Not implemented"); } @@ -943,7 +955,8 @@ namespace dxvk { ID3D11GeometryShader* pShader, ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - Logger::err("D3D11DeviceContext::GSSetShader: Not implemented"); + if (m_state.gs.shader.ptr() != pShader) + Logger::err("D3D11DeviceContext::GSSetShader: Not implemented"); } diff --git a/src/d3d11/d3d11_context.h b/src/d3d11/d3d11_context.h index 192cb4977..b1449f529 100644 --- a/src/d3d11/d3d11_context.h +++ b/src/d3d11/d3d11_context.h @@ -20,6 +20,10 @@ namespace dxvk { Rc device); ~D3D11DeviceContext(); + ULONG AddRef() final; + + ULONG Release() final; + HRESULT QueryInterface( REFIID riid, void** ppvObject) final; diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 57fcf69bd..7b8244e33 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -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); } diff --git a/src/d3d11/d3d11_device.h b/src/d3d11/d3d11_device.h index c72de8d51..ac627be3e 100644 --- a/src/d3d11/d3d11_device.h +++ b/src/d3d11/d3d11_device.h @@ -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 m_dxvkDevice; const Rc m_dxvkAdapter; - Com m_context; + D3D11DeviceContext* m_context = nullptr; std::mutex m_resourceInitMutex; Rc m_resourceInitContext; diff --git a/src/d3d11/d3d11_rasterizer.cpp b/src/d3d11/d3d11_rasterizer.cpp index 27d3e1ff9..8ee2b4937 100644 --- a/src/d3d11/d3d11_rasterizer.cpp +++ b/src/d3d11/d3d11_rasterizer.cpp @@ -78,7 +78,7 @@ namespace dxvk { void D3D11RasterizerState::GetDevice(ID3D11Device** ppDevice) { - *ppDevice = m_device; + *ppDevice = ref(m_device); } diff --git a/src/d3d11/d3d11_state.h b/src/d3d11/d3d11_state.h index 396302ce6..1206a1239 100644 --- a/src/d3d11/d3d11_state.h +++ b/src/d3d11/d3d11_state.h @@ -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 result = new T(device, desc); m_objects.insert({ desc, result });