1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-07 16:54:14 +01:00

[d3d11] Stub out ID3DLowLatencyDevice for D3D11

This commit is contained in:
Philip Rebohle 2025-01-16 16:29:19 +01:00 committed by Philip Rebohle
parent 86c317fbbc
commit 4f9b106d40
2 changed files with 116 additions and 0 deletions

View File

@ -3058,6 +3058,70 @@ namespace dxvk {
D3D11ReflexDevice::D3D11ReflexDevice(
D3D11DXGIDevice* pContainer,
D3D11Device* pDevice)
: m_container(pContainer), m_device(pDevice) {
}
D3D11ReflexDevice::~D3D11ReflexDevice() {
}
ULONG STDMETHODCALLTYPE D3D11ReflexDevice::AddRef() {
return m_container->AddRef();
}
ULONG STDMETHODCALLTYPE D3D11ReflexDevice::Release() {
return m_container->Release();
}
HRESULT STDMETHODCALLTYPE D3D11ReflexDevice::QueryInterface(
REFIID riid,
void** ppvObject) {
return m_container->QueryInterface(riid, ppvObject);
}
BOOL STDMETHODCALLTYPE D3D11ReflexDevice::SupportsLowLatency() {
return FALSE;
}
HRESULT STDMETHODCALLTYPE D3D11ReflexDevice::LatencySleep() {
return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE D3D11ReflexDevice::SetLatencySleepMode(
BOOL LowLatencyEnable,
BOOL LowLatencyBoost,
UINT32 MinIntervalUs) {
return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE D3D11ReflexDevice::SetLatencyMarker(
UINT64 FrameId,
UINT32 MarkerType) {
return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE D3D11ReflexDevice::GetLatencyInfo(
D3D_LOW_LATENCY_RESULTS* pLowLatencyResults) {
*pLowLatencyResults = D3D_LOW_LATENCY_RESULTS();
return E_NOTIMPL;
}
DXGIVkSwapChainFactory::DXGIVkSwapChainFactory(
D3D11DXGIDevice* pContainer,
D3D11Device* pDevice)
@ -3159,6 +3223,7 @@ namespace dxvk {
m_d3d11DeviceExt(this, &m_d3d11Device),
m_d3d11Interop (this, &m_d3d11Device),
m_d3d11Video (this, &m_d3d11Device),
m_d3d11Reflex (this, &m_d3d11Device),
m_d3d11on12 (this, &m_d3d11Device, pD3D12Device, pD3D12Queue),
m_metaDevice (this),
m_dxvkFactory (this, &m_d3d11Device) {
@ -3231,6 +3296,11 @@ namespace dxvk {
return S_OK;
}
if (riid == __uuidof(ID3DLowLatencyDevice)) {
*ppvObject = ref(&m_d3d11Reflex);
return S_OK;
}
if (m_d3d11on12.Is11on12Device()) {
if (riid == __uuidof(ID3D11On12Device)) {
*ppvObject = ref(&m_d3d11on12);

View File

@ -751,6 +751,51 @@ namespace dxvk {
};
/**
* \brief Nvidia Reflex interop
*/
class D3D11ReflexDevice : public ID3DLowLatencyDevice {
public:
D3D11ReflexDevice(
D3D11DXGIDevice* pContainer,
D3D11Device* pDevice);
~D3D11ReflexDevice();
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject);
BOOL STDMETHODCALLTYPE SupportsLowLatency();
HRESULT STDMETHODCALLTYPE LatencySleep();
HRESULT STDMETHODCALLTYPE SetLatencySleepMode(
BOOL LowLatencyEnable,
BOOL LowLatencyBoost,
UINT32 MinIntervalUs);
HRESULT STDMETHODCALLTYPE SetLatencyMarker(
UINT64 FrameId,
UINT32 MarkerType);
HRESULT STDMETHODCALLTYPE GetLatencyInfo(
D3D_LOW_LATENCY_RESULTS* pLowLatencyResults);
private:
D3D11DXGIDevice* m_container;
D3D11Device* m_device;
};
/**
* \brief DXVK swap chain factory
*/
@ -914,6 +959,7 @@ namespace dxvk {
D3D11DeviceExt m_d3d11DeviceExt;
D3D11VkInterop m_d3d11Interop;
D3D11VideoDevice m_d3d11Video;
D3D11ReflexDevice m_d3d11Reflex;
D3D11on12Device m_d3d11on12;
DXGIDXVKDevice m_metaDevice;