1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-21 22:54:16 +01:00
dxvk/src/d3d11/d3d11_present.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

74 lines
1.6 KiB
C++

#pragma once
#include "../dxgi/dxgi_device.h"
#include "../dxgi/dxgi_interfaces.h"
#include "d3d11_include.h"
#include "d3d11_texture.h"
namespace dxvk {
class D3D11Device;
class D3D11VkBackBuffer : public ComObject<IDXGIVkBackBuffer> {
public:
D3D11VkBackBuffer(D3D11Texture2D* pTexture)
: m_texture(pTexture) { }
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject) final;
Rc<DxvkImage> GetDXVKImage() final;
public:
Com<D3D11Texture2D> m_texture;
};
/**
* \brief Present device
*
* Wires up some swap chain related
* functions to the D3D11 device.
*/
class D3D11Presenter final : public IDXGIVkPresenter {
public:
D3D11Presenter(
IDXGIObject* pContainer,
ID3D11Device* pDevice);
~D3D11Presenter();
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject);
HRESULT STDMETHODCALLTYPE CreateSwapChainBackBuffer(
const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
IDXGIVkBackBuffer** ppInterface);
HRESULT STDMETHODCALLTYPE FlushRenderingCommands();
HRESULT STDMETHODCALLTYPE GetDevice(
REFGUID riid,
void** ppvDevice);
private:
IDXGIObject* m_container;
ID3D11Device* m_device;
};
}