Skip to content

Commit

Permalink
[d3d11] Pass device directly to D3D11DXGIKeyedMutex
Browse files Browse the repository at this point in the history
  • Loading branch information
gofman authored and misyltoad committed Sep 13, 2023
1 parent c113b79 commit f93cfbc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/d3d11/d3d11_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace dxvk {
const D3D11_ON_12_RESOURCE_INFO* p11on12Info)
: D3D11DeviceChild<ID3D11Buffer>(pDevice),
m_desc (*pDesc),
m_resource (this),
m_resource (this, pDevice),
m_d3d10 (this) {
DxvkBufferCreateInfo info;
info.flags = 0;
Expand Down
14 changes: 7 additions & 7 deletions src/d3d11/d3d11_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
namespace dxvk {

D3D11DXGIKeyedMutex::D3D11DXGIKeyedMutex(
ID3D11Resource* pResource)
: m_resource(pResource) {
Com<ID3D11Device> device;
m_resource->GetDevice(&device);
m_device = static_cast<D3D11Device*>(device.ptr());
ID3D11Resource* pResource,
D3D11Device* pDevice)
: m_resource(pResource),
m_device(pDevice) {

m_supported = m_device->GetDXVKDevice()->features().khrWin32KeyedMutex
&& m_device->GetDXVKDevice()->vkd()->wine_vkAcquireKeyedMutex != nullptr
Expand Down Expand Up @@ -120,9 +119,10 @@ namespace dxvk {
}

D3D11DXGIResource::D3D11DXGIResource(
ID3D11Resource* pResource)
ID3D11Resource* pResource,
D3D11Device* pDevice)
: m_resource(pResource),
m_keyedMutex(pResource) {
m_keyedMutex(pResource, pDevice) {

}

Expand Down
6 changes: 4 additions & 2 deletions src/d3d11/d3d11_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace dxvk {
public:

D3D11DXGIKeyedMutex(
ID3D11Resource* pResource);
ID3D11Resource* pResource,
D3D11Device* pDevice);

~D3D11DXGIKeyedMutex();

Expand Down Expand Up @@ -88,7 +89,8 @@ namespace dxvk {
public:

D3D11DXGIResource(
ID3D11Resource* pResource);
ID3D11Resource* pResource,
D3D11Device* pDevice);

~D3D11DXGIResource();

Expand Down
10 changes: 5 additions & 5 deletions src/d3d11/d3d11_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ namespace dxvk {
m_texture (this, pDevice, pDesc, p11on12Info, D3D11_RESOURCE_DIMENSION_TEXTURE1D, 0, VK_NULL_HANDLE, nullptr),
m_interop (this, &m_texture),
m_surface (this, &m_texture),
m_resource(this),
m_resource(this, pDevice),
m_d3d10 (this) {

}
Expand Down Expand Up @@ -1205,7 +1205,7 @@ namespace dxvk {
m_texture (this, pDevice, pDesc, p11on12Info, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, VK_NULL_HANDLE, hSharedHandle),
m_interop (this, &m_texture),
m_surface (this, &m_texture),
m_resource (this),
m_resource (this, pDevice),
m_d3d10 (this),
m_swapChain (nullptr) {
}
Expand All @@ -1220,7 +1220,7 @@ namespace dxvk {
m_texture (this, pDevice, pDesc, nullptr, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DxgiUsage, vkImage, nullptr),
m_interop (this, &m_texture),
m_surface (this, &m_texture),
m_resource (this),
m_resource (this, pDevice),
m_d3d10 (this),
m_swapChain (nullptr) {

Expand All @@ -1236,7 +1236,7 @@ namespace dxvk {
m_texture (this, pDevice, pDesc, nullptr, D3D11_RESOURCE_DIMENSION_TEXTURE2D, DxgiUsage, VK_NULL_HANDLE, nullptr),
m_interop (this, &m_texture),
m_surface (this, &m_texture),
m_resource (this),
m_resource (this, pDevice),
m_d3d10 (this),
m_swapChain (pSwapChain) {

Expand Down Expand Up @@ -1384,7 +1384,7 @@ namespace dxvk {
: D3D11DeviceChild<ID3D11Texture3D1>(pDevice),
m_texture (this, pDevice, pDesc, p11on12Info, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, VK_NULL_HANDLE, nullptr),
m_interop (this, &m_texture),
m_resource(this),
m_resource(this, pDevice),
m_d3d10 (this) {

}
Expand Down

0 comments on commit f93cfbc

Please sign in to comment.