dxvk/src/dxgi/dxgi_output.h

137 lines
4.3 KiB
C
Raw Normal View History

2017-10-11 02:09:04 +01:00
#pragma once
#include "dxgi_monitor.h"
2017-10-11 02:09:04 +01:00
#include "dxgi_object.h"
namespace dxvk {
class DxgiAdapter;
class DxgiFactory;
2018-10-23 10:07:23 +01:00
/**
* \brief Number of gamma control points
*/
constexpr uint32_t DXGI_VK_GAMMA_CP_COUNT = 1024;
/**
* \brief Computes gamma control point location
*
* \param [in] CpIndex Control point ID
* \returns Location of the control point
*/
inline float GammaControlPointLocation(uint32_t CpIndex) {
return float(CpIndex) / float(DXGI_VK_GAMMA_CP_COUNT - 1);
}
2017-10-11 02:09:04 +01:00
2019-09-20 15:43:01 +01:00
class DxgiOutput : public DxgiObject<IDXGIOutput5> {
2017-10-11 02:09:04 +01:00
public:
DxgiOutput(
const Com<DxgiFactory>& factory,
const Com<DxgiAdapter>& adapter,
HMONITOR monitor);
2017-10-11 02:09:04 +01:00
~DxgiOutput();
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE QueryInterface(
2018-04-14 11:02:55 +01:00
REFIID riid,
void** ppvObject) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE GetParent(
2018-04-14 11:02:55 +01:00
REFIID riid,
void** ppParent) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE FindClosestMatchingMode(
2018-04-14 11:02:55 +01:00
const DXGI_MODE_DESC* pModeToMatch,
DXGI_MODE_DESC* pClosestMatch,
IUnknown* pConcernedDevice) final;
HRESULT STDMETHODCALLTYPE FindClosestMatchingMode1(
const DXGI_MODE_DESC1* pModeToMatch,
DXGI_MODE_DESC1* pClosestMatch,
IUnknown* pConcernedDevice) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE GetDesc(
2018-04-14 11:02:55 +01:00
DXGI_OUTPUT_DESC* pDesc) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE GetDisplayModeList(
2018-04-14 11:02:55 +01:00
DXGI_FORMAT EnumFormat,
UINT Flags,
UINT* pNumModes,
DXGI_MODE_DESC* pDesc) final;
2017-10-11 02:09:04 +01:00
HRESULT STDMETHODCALLTYPE GetDisplayModeList1(
DXGI_FORMAT EnumFormat,
UINT Flags,
UINT* pNumModes,
DXGI_MODE_DESC1* pDesc) final;
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData(
2018-04-14 11:02:55 +01:00
IDXGISurface* pDestination) final;
HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData1(
IDXGIResource* pDestination) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE GetFrameStatistics(
2018-04-14 11:02:55 +01:00
DXGI_FRAME_STATISTICS* pStats) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE GetGammaControl(
2018-04-14 11:02:55 +01:00
DXGI_GAMMA_CONTROL* pArray) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE GetGammaControlCapabilities(
2017-10-11 02:09:04 +01:00
DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) final;
2017-12-12 11:50:52 +00:00
void STDMETHODCALLTYPE ReleaseOwnership() final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE SetDisplaySurface(
2018-04-14 11:02:55 +01:00
IDXGISurface* pScanoutSurface) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE SetGammaControl(
2018-04-14 11:02:55 +01:00
const DXGI_GAMMA_CONTROL* pArray) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE TakeOwnership(
2018-04-14 11:02:55 +01:00
IUnknown* pDevice,
BOOL Exclusive) final;
2017-10-11 02:09:04 +01:00
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE WaitForVBlank() final;
HRESULT STDMETHODCALLTYPE DuplicateOutput(
IUnknown* pDevice,
IDXGIOutputDuplication** ppOutputDuplication) final;
2017-10-11 02:09:04 +01:00
2019-09-20 15:43:01 +01:00
HRESULT STDMETHODCALLTYPE DuplicateOutput1(
IUnknown* pDevice,
UINT Flags,
UINT SupportedFormatsCount,
const DXGI_FORMAT* pSupportedFormats,
IDXGIOutputDuplication** ppOutputDuplication) final;
2018-10-11 08:57:56 +01:00
BOOL STDMETHODCALLTYPE SupportsOverlays() final;
HRESULT STDMETHODCALLTYPE CheckOverlaySupport(
DXGI_FORMAT EnumFormat,
IUnknown* pConcernedDevice,
UINT* pFlags) final;
HRESULT STDMETHODCALLTYPE CheckOverlayColorSpaceSupport(
DXGI_FORMAT Format,
DXGI_COLOR_SPACE_TYPE ColorSpace,
IUnknown* pConcernedDevice,
UINT* pFlags) final;
2017-10-11 02:09:04 +01:00
private:
DxgiMonitorInfo* m_monitorInfo = nullptr;
Com<DxgiAdapter> m_adapter = nullptr;
HMONITOR m_monitor = nullptr;
static void FilterModesByDesc(
std::vector<DXGI_MODE_DESC1>& Modes,
const DXGI_MODE_DESC1& TargetMode);
2017-10-11 02:09:04 +01:00
};
}