1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-08 10:46:09 +01:00
dxvk/src/dxgi/dxgi_swapchain.h

123 lines
3.1 KiB
C
Raw Normal View History

2017-10-11 16:22:13 +02:00
#pragma once
#include <memory>
#include <mutex>
#include <dxvk_surface.h>
#include <dxvk_swapchain.h>
2017-10-11 16:22:13 +02:00
#include "dxgi_interfaces.h"
#include "dxgi_object.h"
#include "dxgi_presenter.h"
2017-10-11 16:22:13 +02:00
#include "../d3d11/d3d11_interfaces.h"
#include "../spirv/spirv_module.h"
2017-10-11 16:22:13 +02:00
namespace dxvk {
class DxgiDevice;
2017-10-11 16:22:13 +02:00
class DxgiFactory;
class DxgiSwapChain : public DxgiObject<IDXGISwapChain> {
public:
DxgiSwapChain(
DxgiFactory* factory,
IUnknown* pDevice,
DXGI_SWAP_CHAIN_DESC* pDesc);
~DxgiSwapChain();
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE QueryInterface(
2017-10-11 16:22:13 +02:00
REFIID riid,
void** ppvObject) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetParent(
2017-10-11 16:22:13 +02:00
REFIID riid,
void** ppParent) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetDevice(
2017-10-11 16:22:13 +02:00
REFIID riid,
void** ppDevice) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetBuffer(
2017-10-11 16:22:13 +02:00
UINT Buffer,
REFIID riid,
void** ppSurface) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetContainingOutput(
2017-10-11 16:22:13 +02:00
IDXGIOutput **ppOutput) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetDesc(
2017-10-11 16:22:13 +02:00
DXGI_SWAP_CHAIN_DESC *pDesc) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetFrameStatistics(
2017-10-11 16:22:13 +02:00
DXGI_FRAME_STATISTICS *pStats) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetFullscreenState(
2017-10-11 16:22:13 +02:00
BOOL *pFullscreen,
IDXGIOutput **ppTarget) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE GetLastPresentCount(
2017-10-11 16:22:13 +02:00
UINT *pLastPresentCount) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE Present(
2017-10-11 16:22:13 +02:00
UINT SyncInterval,
UINT Flags) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE ResizeBuffers(
2017-10-11 16:22:13 +02:00
UINT BufferCount,
UINT Width,
UINT Height,
DXGI_FORMAT NewFormat,
UINT SwapChainFlags) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE ResizeTarget(
2017-10-11 16:22:13 +02:00
const DXGI_MODE_DESC *pNewTargetParameters) final;
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE SetFullscreenState(
2017-10-11 16:22:13 +02:00
BOOL Fullscreen,
IDXGIOutput *pTarget) final;
private:
struct WindowState {
uint32_t style = 0;
uint32_t exstyle = 0;
RECT rect = { 0, 0, 0, 0 };
};
std::recursive_mutex m_mutex;
Com<DxgiFactory> m_factory;
Com<DxgiAdapter> m_adapter;
Com<DxgiDevice> m_device;
2018-03-28 19:06:00 +02:00
Com<IDXGIVkPresenter> m_presentDevice;
2017-10-11 16:22:13 +02:00
DXGI_SWAP_CHAIN_DESC m_desc;
DXGI_FRAME_STATISTICS m_stats;
Rc<DxgiPresenter> m_presenter;
2018-03-28 19:06:00 +02:00
Com<IDXGIVkBackBuffer> m_backBuffer;
WindowState m_windowState;
HRESULT CreatePresenter();
HRESULT CreateBackBuffer();
VkExtent2D GetWindowSize() const;
HRESULT EnterFullscreenMode(
IDXGIOutput *pTarget);
HRESULT LeaveFullscreenMode();
HRESULT GetSampleCount(
UINT Count,
VkSampleCountFlagBits* pCount) const;
2017-10-11 16:22:13 +02:00
};
}