1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-14 18:23:52 +01:00
dxvk/src/d3d11/d3d11_present.h
Philip Rebohle c223e35608
[d3d11] Do not keep a strong reference to the swap chain back buffer
Fixes crash in Yakuza 0 with fullscreen mode enabled. SEGA, please,
stop being lazy and learn to use reference counting correctly.
2018-08-05 21:31:13 +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);
~D3D11VkBackBuffer();
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject) final;
Rc<DxvkImage> GetDXVKImage() final;
public:
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_DESC1* pSwapChainDesc,
IDXGIVkBackBuffer** ppInterface);
HRESULT STDMETHODCALLTYPE FlushRenderingCommands();
HRESULT STDMETHODCALLTYPE GetDevice(
REFGUID riid,
void** ppvDevice);
private:
IDXGIObject* m_container;
ID3D11Device* m_device;
};
}