1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-25 07:54:15 +01:00
dxvk/src/dxgi/dxgi_device.h
Philip Rebohle ae88f83b86
[d3d11] Introduce D3D11DeviceContainer
Refactored DxgiVkDevice, D3D11Device and D3D11Presenter
to behave more like aggregable objects, where the new
D3D11DeviceContainer class is the COM aggregate object.
Fixes the reference counting issue outlined in #210.
2018-03-28 21:24:52 +02:00

100 lines
3.0 KiB
C++

#pragma once
#include <dxvk_device.h>
#include "dxgi_adapter.h"
#include "dxgi_interfaces.h"
namespace dxvk {
class DxgiFactory;
class DxgiDevice : public IDXGIVkDevice {
public:
DxgiDevice(
IDXGIObject* pContainer,
IDXGIVkAdapter* pAdapter,
const VkPhysicalDeviceFeatures* pFeatures);
~DxgiDevice();
ULONG STDMETHODCALLTYPE AddRef() final;
ULONG STDMETHODCALLTYPE Release() final;
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject) final;
HRESULT STDMETHODCALLTYPE GetParent(
REFIID riid,
void** ppParent) final;
HRESULT STDMETHODCALLTYPE GetPrivateData(
REFGUID Name,
UINT* pDataSize,
void* pData) final;
HRESULT STDMETHODCALLTYPE SetPrivateData(
REFGUID Name,
UINT DataSize,
const void* pData) final;
HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
REFGUID Name,
const IUnknown* pUnknown) final;
HRESULT STDMETHODCALLTYPE CreateSurface(
const DXGI_SURFACE_DESC* pDesc,
UINT NumSurfaces,
DXGI_USAGE Usage,
const DXGI_SHARED_RESOURCE* pSharedResource,
IDXGISurface** ppSurface) final;
HRESULT STDMETHODCALLTYPE GetAdapter(
IDXGIAdapter** pAdapter) final;
HRESULT STDMETHODCALLTYPE GetGPUThreadPriority(
INT* pPriority) final;
HRESULT STDMETHODCALLTYPE QueryResourceResidency(
IUnknown* const* ppResources,
DXGI_RESIDENCY* pResidencyStatus,
UINT NumResources) final;
HRESULT STDMETHODCALLTYPE SetGPUThreadPriority(
INT Priority) final;
HRESULT STDMETHODCALLTYPE GetMaximumFrameLatency(
UINT* pMaxLatency) final;
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;
Rc<DxvkDevice> STDMETHODCALLTYPE GetDXVKDevice() final;
private:
IDXGIObject* m_container;
Com<IDXGIVkAdapter> m_adapter;
Rc<DxvkDevice> m_device;
};
}