Skip to content

Commit

Permalink
[d3d11] Implement ID3D11On12Device1
Browse files Browse the repository at this point in the history
  • Loading branch information
doitsujin committed Mar 2, 2025
1 parent 106032f commit b5f23d8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/d3d11/d3d11_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,8 @@ namespace dxvk {
}

if (m_d3d11on12.Is11on12Device()) {
if (riid == __uuidof(ID3D11On12Device)) {
if (riid == __uuidof(ID3D11On12Device)
|| riid == __uuidof(ID3D11On12Device1_DXVK)) {
*ppvObject = ref(&m_d3d11on12);
return S_OK;
}
Expand Down
7 changes: 7 additions & 0 deletions src/d3d11/d3d11_on_12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,11 @@ namespace dxvk {
}
}


HRESULT STDMETHODCALLTYPE D3D11on12Device::GetD3D12Device(
REFIID riid,
void** ppvDevice) {
return m_d3d12Queue->GetDevice(riid, ppvDevice);
}

}
25 changes: 24 additions & 1 deletion src/d3d11/d3d11_on_12.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

#include "../util/log/log.h"

/**
* \brief Declaration of the ID3D11On12Device1 interface
*
* Various different headers that we need to be compatible with
* can't seem to agree on the signature of GetD3D12Device, and
* older wine/mingw headers don't support this interface at all.
*/
MIDL_INTERFACE("bdb64df4-ea2f-4c70-b861-aaab1258bb5d")
ID3D11On12Device1_DXVK : public ID3D11On12Device {
virtual HRESULT STDMETHODCALLTYPE GetD3D12Device(
REFIID riid,
void** ppvDevice) = 0;
};


namespace dxvk {

class D3D11Device;
Expand All @@ -22,7 +37,7 @@ namespace dxvk {
};


class D3D11on12Device : public ID3D11On12Device {
class D3D11on12Device : public ID3D11On12Device1_DXVK {

public:

Expand Down Expand Up @@ -58,6 +73,10 @@ namespace dxvk {
ID3D11Resource* const* ppResources,
UINT ResourceCount);

HRESULT STDMETHODCALLTYPE GetD3D12Device(
REFIID riid,
void** ppvDevice);

bool Is11on12Device() const {
return m_d3d12Device != nullptr;
}
Expand All @@ -73,3 +92,7 @@ namespace dxvk {
};

}

#ifndef _MSC_VER
__CRT_UUID_DECL(ID3D11On12Device1_DXVK, 0xbdb64df4,0xea2f,0x4c70,0xb8,0x61,0xaa,0xab,0x12,0x58,0xbb,0x5d);
#endif

0 comments on commit b5f23d8

Please sign in to comment.