From 608cd33a25387331bb725c75e79a704dc069beaf Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sat, 17 Mar 2018 03:48:55 +0300 Subject: [PATCH] [dxgi] added stub implementation of IDXGIDevice2 (#172) --- src/dxgi/dxgi_device.cpp | 26 ++++++++++++++++++++++++++ src/dxgi/dxgi_device.h | 13 +++++++++++++ src/dxgi/dxgi_interfaces.h | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/dxgi/dxgi_device.cpp b/src/dxgi/dxgi_device.cpp index 8fb675b5a..876b2ac7b 100644 --- a/src/dxgi/dxgi_device.cpp +++ b/src/dxgi/dxgi_device.cpp @@ -21,6 +21,7 @@ namespace dxvk { COM_QUERY_IFACE(riid, ppvObject, IDXGIObject); COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice); COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice1); + COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice2); COM_QUERY_IFACE(riid, ppvObject, IDXGIDevicePrivate); if (m_layer != nullptr) @@ -96,6 +97,31 @@ namespace dxvk { } + HRESULT STDMETHODCALLTYPE DxgiDevice::OfferResources( + UINT NumResources, + IDXGIResource* const* ppResources, + DXGI_OFFER_RESOURCE_PRIORITY Priority) { + + Logger::err("DxgiDevice::OfferResources: not implemented"); + return DXGI_ERROR_UNSUPPORTED; + } + + + HRESULT STDMETHODCALLTYPE DxgiDevice::ReclaimResources( + UINT NumResources, + IDXGIResource* const* ppResources, + BOOL* pDiscarded) { + Logger::err("DxgiDevice::ReclaimResources: not implemented"); + return DXGI_ERROR_UNSUPPORTED; + } + + + HRESULT STDMETHODCALLTYPE DxgiDevice::EnqueueSetEvent(HANDLE hEvent) { + Logger::err("DxgiDevice::EnqueueSetEvent: not implemented"); + return DXGI_ERROR_UNSUPPORTED; + } + + void STDMETHODCALLTYPE DxgiDevice::SetDeviceLayer(IUnknown* layer) { m_layer = layer; } diff --git a/src/dxgi/dxgi_device.h b/src/dxgi/dxgi_device.h index e81112a8c..1e6f2d66e 100644 --- a/src/dxgi/dxgi_device.h +++ b/src/dxgi/dxgi_device.h @@ -52,6 +52,19 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency( UINT MaxLatency) final; + + HRESULT STDMETHODCALLTYPE OfferResources( + UINT NumResources, + IDXGIResource* const* ppResources, + DXGI_OFFER_RESOURCE_PRIORITY Priority) final; + + HRESULT STDMETHODCALLTYPE ReclaimResources( + UINT NumResources, + IDXGIResource* const* ppResources, + BOOL* pDiscarded) final; + + HRESULT STDMETHODCALLTYPE EnqueueSetEvent( + HANDLE hEvent) final; void STDMETHODCALLTYPE SetDeviceLayer( IUnknown* layer) final; diff --git a/src/dxgi/dxgi_interfaces.h b/src/dxgi/dxgi_interfaces.h index 441655336..1f6f81cad 100644 --- a/src/dxgi/dxgi_interfaces.h +++ b/src/dxgi/dxgi_interfaces.h @@ -88,7 +88,7 @@ IDXGIAdapterPrivate : public IDXGIAdapter1 { * this interface. */ MIDL_INTERFACE("7a622cf6-627a-46b2-b52f-360ef3da831c") -IDXGIDevicePrivate : public IDXGIDevice1 { +IDXGIDevicePrivate : public IDXGIDevice2 { static const GUID guid; virtual void STDMETHODCALLTYPE SetDeviceLayer(