1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 05:52:11 +01:00

[d3d11] Implement IDXGIDevice4

This commit is contained in:
Philip Rebohle 2019-09-20 16:59:31 +02:00
parent 32410a4f2b
commit 7514aa1ec8
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 56 additions and 7 deletions

View File

@ -2509,7 +2509,8 @@ namespace dxvk {
|| riid == __uuidof(IDXGIDevice) || riid == __uuidof(IDXGIDevice)
|| riid == __uuidof(IDXGIDevice1) || riid == __uuidof(IDXGIDevice1)
|| riid == __uuidof(IDXGIDevice2) || riid == __uuidof(IDXGIDevice2)
|| riid == __uuidof(IDXGIDevice3)) { || riid == __uuidof(IDXGIDevice3)
|| riid == __uuidof(IDXGIDevice4)) {
*ppvObject = ref(this); *ppvObject = ref(this);
return S_OK; return S_OK;
} }
@ -2657,18 +2658,55 @@ namespace dxvk {
UINT NumResources, UINT NumResources,
IDXGIResource* const* ppResources, IDXGIResource* const* ppResources,
DXGI_OFFER_RESOURCE_PRIORITY Priority) { DXGI_OFFER_RESOURCE_PRIORITY Priority) {
return OfferResources1(NumResources, ppResources, Priority, 0);
Logger::err("D3D11DXGIDevice::OfferResources: Not implemented");
return DXGI_ERROR_UNSUPPORTED;
} }
HRESULT STDMETHODCALLTYPE D3D11DXGIDevice::OfferResources1(
UINT NumResources,
IDXGIResource* const* ppResources,
DXGI_OFFER_RESOURCE_PRIORITY Priority,
UINT Flags) {
static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11DXGIDevice::OfferResources1: Stub");
return S_OK;
}
HRESULT STDMETHODCALLTYPE D3D11DXGIDevice::ReclaimResources( HRESULT STDMETHODCALLTYPE D3D11DXGIDevice::ReclaimResources(
UINT NumResources, UINT NumResources,
IDXGIResource* const* ppResources, IDXGIResource* const* ppResources,
BOOL* pDiscarded) { BOOL* pDiscarded) {
Logger::err("D3D11DXGIDevice::ReclaimResources: Not implemented"); static bool s_errorShown = false;
return DXGI_ERROR_UNSUPPORTED;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11DXGIDevice::ReclaimResources: Stub");
if (pDiscarded)
*pDiscarded = false;
return S_OK;
}
HRESULT STDMETHODCALLTYPE D3D11DXGIDevice::ReclaimResources1(
UINT NumResources,
IDXGIResource* const* ppResources,
DXGI_RECLAIM_RESOURCE_RESULTS* pResults) {
static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11DXGIDevice::ReclaimResources1: Stub");
if (pResults) {
for (uint32_t i = 0; i < NumResources; i++)
pResults[i] = DXGI_RECLAIM_RESOURCE_RESULT_OK;
}
return S_OK;
} }

View File

@ -575,7 +575,7 @@ namespace dxvk {
* Stores all the objects that contribute to the D3D11 * Stores all the objects that contribute to the D3D11
* device implementation, including the DXGI device. * device implementation, including the DXGI device.
*/ */
class D3D11DXGIDevice : public DxgiObject<IDXGIDevice3> { class D3D11DXGIDevice : public DxgiObject<IDXGIDevice4> {
constexpr static uint32_t DefaultFrameLatency = 3; constexpr static uint32_t DefaultFrameLatency = 3;
public: public:
@ -627,10 +627,21 @@ namespace dxvk {
IDXGIResource* const* ppResources, IDXGIResource* const* ppResources,
DXGI_OFFER_RESOURCE_PRIORITY Priority) final; DXGI_OFFER_RESOURCE_PRIORITY Priority) final;
HRESULT STDMETHODCALLTYPE OfferResources1(
UINT NumResources,
IDXGIResource* const* ppResources,
DXGI_OFFER_RESOURCE_PRIORITY Priority,
UINT Flags) final;
HRESULT STDMETHODCALLTYPE ReclaimResources( HRESULT STDMETHODCALLTYPE ReclaimResources(
UINT NumResources, UINT NumResources,
IDXGIResource* const* ppResources, IDXGIResource* const* ppResources,
BOOL* pDiscarded) final; BOOL* pDiscarded) final;
HRESULT STDMETHODCALLTYPE ReclaimResources1(
UINT NumResources,
IDXGIResource* const* ppResources,
DXGI_RECLAIM_RESOURCE_RESULTS* pResults) final;
HRESULT STDMETHODCALLTYPE EnqueueSetEvent( HRESULT STDMETHODCALLTYPE EnqueueSetEvent(
HANDLE hEvent) final; HANDLE hEvent) final;