mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[d3d11] Fixed yet another ref counting bug
This commit is contained in:
parent
c3a29e9de0
commit
037e9a643d
@ -72,8 +72,6 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Set up logic op state as well
|
// Set up logic op state as well
|
||||||
ctx->setLogicOpState(m_loState);
|
ctx->setLogicOpState(m_loState);
|
||||||
|
|
||||||
// TODO set blend factor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,6 +47,16 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ULONG D3D11DeviceContext::AddRef() {
|
||||||
|
return m_parent->AddRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ULONG D3D11DeviceContext::Release() {
|
||||||
|
return m_parent->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT D3D11DeviceContext::QueryInterface(
|
HRESULT D3D11DeviceContext::QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void** ppvObject) {
|
void** ppvObject) {
|
||||||
@ -815,7 +825,8 @@ namespace dxvk {
|
|||||||
ID3D11HullShader* pHullShader,
|
ID3D11HullShader* pHullShader,
|
||||||
ID3D11ClassInstance* const* ppClassInstances,
|
ID3D11ClassInstance* const* ppClassInstances,
|
||||||
UINT NumClassInstances) {
|
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,
|
ID3D11DomainShader* pDomainShader,
|
||||||
ID3D11ClassInstance* const* ppClassInstances,
|
ID3D11ClassInstance* const* ppClassInstances,
|
||||||
UINT NumClassInstances) {
|
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,
|
ID3D11GeometryShader* pShader,
|
||||||
ID3D11ClassInstance* const* ppClassInstances,
|
ID3D11ClassInstance* const* ppClassInstances,
|
||||||
UINT NumClassInstances) {
|
UINT NumClassInstances) {
|
||||||
Logger::err("D3D11DeviceContext::GSSetShader: Not implemented");
|
if (m_state.gs.shader.ptr() != pShader)
|
||||||
|
Logger::err("D3D11DeviceContext::GSSetShader: Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@ namespace dxvk {
|
|||||||
Rc<DxvkDevice> device);
|
Rc<DxvkDevice> device);
|
||||||
~D3D11DeviceContext();
|
~D3D11DeviceContext();
|
||||||
|
|
||||||
|
ULONG AddRef() final;
|
||||||
|
|
||||||
|
ULONG Release() final;
|
||||||
|
|
||||||
HRESULT QueryInterface(
|
HRESULT QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void** ppvObject) final;
|
void** ppvObject) final;
|
||||||
|
@ -40,6 +40,7 @@ namespace dxvk {
|
|||||||
D3D11Device::~D3D11Device() {
|
D3D11Device::~D3D11Device() {
|
||||||
m_presentDevice->SetDeviceLayer(nullptr);
|
m_presentDevice->SetDeviceLayer(nullptr);
|
||||||
m_dxgiDevice->SetDeviceLayer(nullptr);
|
m_dxgiDevice->SetDeviceLayer(nullptr);
|
||||||
|
delete m_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1092,7 +1093,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void D3D11Device::GetImmediateContext(ID3D11DeviceContext** ppImmediateContext) {
|
void D3D11Device::GetImmediateContext(ID3D11DeviceContext** ppImmediateContext) {
|
||||||
*ppImmediateContext = m_context.ref();
|
*ppImmediateContext = ref(m_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "../util/com/com_private_data.h"
|
#include "../util/com/com_private_data.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
class DxgiAdapter;
|
class DxgiAdapter;
|
||||||
class D3D11DeviceContext;
|
class D3D11DeviceContext;
|
||||||
class D3D11PresentDevice;
|
class D3D11PresentDevice;
|
||||||
@ -243,7 +242,7 @@ namespace dxvk {
|
|||||||
const Rc<DxvkDevice> m_dxvkDevice;
|
const Rc<DxvkDevice> m_dxvkDevice;
|
||||||
const Rc<DxvkAdapter> m_dxvkAdapter;
|
const Rc<DxvkAdapter> m_dxvkAdapter;
|
||||||
|
|
||||||
Com<ID3D11DeviceContext> m_context;
|
D3D11DeviceContext* m_context = nullptr;
|
||||||
|
|
||||||
std::mutex m_resourceInitMutex;
|
std::mutex m_resourceInitMutex;
|
||||||
Rc<DxvkContext> m_resourceInitContext;
|
Rc<DxvkContext> m_resourceInitContext;
|
||||||
|
@ -78,7 +78,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void D3D11RasterizerState::GetDevice(ID3D11Device** ppDevice) {
|
void D3D11RasterizerState::GetDevice(ID3D11Device** ppDevice) {
|
||||||
*ppDevice = m_device;
|
*ppDevice = ref(m_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ namespace dxvk {
|
|||||||
auto pair = m_objects.find(desc);
|
auto pair = m_objects.find(desc);
|
||||||
|
|
||||||
if (pair != m_objects.end())
|
if (pair != m_objects.end())
|
||||||
return pair->second.ptr();
|
return pair->second.ref();
|
||||||
|
|
||||||
Com<T> result = new T(device, desc);
|
Com<T> result = new T(device, desc);
|
||||||
m_objects.insert({ desc, result });
|
m_objects.insert({ desc, result });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user