1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[dxgi] Add new COM interface for per-monitor data

This commit is contained in:
Philip Rebohle 2019-03-14 15:20:40 +01:00
parent f272071d8d
commit cfdac13ea5
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 62 additions and 11 deletions

View File

@ -7,6 +7,7 @@
namespace dxvk {
class DxgiAdapter;
class DxgiSwapChain;
class DxvkAdapter;
class DxvkBuffer;
class DxvkDevice;
@ -16,6 +17,17 @@ namespace dxvk {
struct IDXGIVkInteropDevice;
/**
* \brief Per-monitor data
*/
struct DXGI_VK_MONITOR_DATA {
dxvk::DxgiSwapChain* pSwapChain;
DXGI_FRAME_STATISTICS FrameStats;
DXGI_GAMMA_CONTROL GammaCurve;
};
/**
* \brief Private DXGI presenter
*
@ -78,6 +90,52 @@ IDXGIVkAdapter : public IDXGIAdapter3 {
};
/**
* \brief Private DXGI monitor info interface
*
* Can be queried from the DXGI factory to store monitor
* info globally, with a lifetime that exceeds that of
* the \c IDXGIOutput or \c IDXGIAdapter objects.
*/
MIDL_INTERFACE("c06a236f-5be3-448a-8943-89c611c0c2c1")
IDXGIVkMonitorInfo : public IUnknown {
static const GUID guid;
/**
* \brief Initializes monitor data
*
* Fails if data for the given monitor already exists.
* \param [in] hMonitor The monitor handle
* \param [in] pData Initial data
*/
virtual HRESULT STDMETHODCALLTYPE InitMonitorData(
HMONITOR hMonitor,
const DXGI_VK_MONITOR_DATA* pData) = 0;
/**
* \brief Retrieves and locks monitor data
*
* Fails if no data for the given monitor exists.
* \param [in] hMonitor The monitor handle
* \param [out] Pointer to monitor data
* \returns S_OK on success
*/
virtual HRESULT STDMETHODCALLTYPE AcquireMonitorData(
HMONITOR hMonitor,
DXGI_VK_MONITOR_DATA** ppData) = 0;
/**
* \brief Unlocks monitor data
*
* Must be called after each successful
* call to \ref AcquireMonitorData.
* \param [in] hMonitor The monitor handle
*/
virtual void STDMETHODCALLTYPE ReleaseMonitorData() = 0;
};
/**
* \brief DXGI surface interface for Vulkan interop
*
@ -241,12 +299,14 @@ IWineDXGISwapChainFactory : public IUnknown {
#ifdef _MSC_VER
struct __declspec(uuid("907bf281-ea3c-43b4-a8e4-9f231107b4ff")) IDXGIVkAdapter;
struct __declspec(uuid("c06a236f-5be3-448a-8943-89c611c0c2c1")) IDXGIVkMonitorInfo;
struct __declspec(uuid("e2ef5fa5-dc21-4af7-90c4-f67ef6a09323")) IDXGIVkInteropDevice;
struct __declspec(uuid("5546cf8c-77e7-4341-b05d-8d4d5000e77d")) IDXGIVkInteropSurface;
struct __declspec(uuid("104001a6-7f36-4957-b932-86ade9567d91")) IDXGIVkSwapChain;
struct __declspec(uuid("53cb4ff0-c25a-4164-a891-0e83db0a7aac")) IWineDXGISwapChainFactory;
#else
DXVK_DEFINE_GUID(IDXGIVkAdapter);
DXVK_DEFINE_GUID(IDXGIVkMonitorInfo);
DXVK_DEFINE_GUID(IDXGIVkInteropDevice);
DXVK_DEFINE_GUID(IDXGIVkInteropSurface);
DXVK_DEFINE_GUID(IDXGIVkSwapChain);

View File

@ -3,22 +3,12 @@
#include <mutex>
#include <unordered_map>
#include "dxgi_include.h"
#include "dxgi_interfaces.h"
namespace dxvk {
class DxgiSwapChain;
/**
* \brief Per-monitor data
*/
struct DXGI_VK_MONITOR_DATA {
DxgiSwapChain* pSwapChain;
DXGI_FRAME_STATISTICS FrameStats;
DXGI_GAMMA_CONTROL GammaCurve;
};
/**
* \brief Queries bits per pixel for a format
*

View File

@ -5,6 +5,7 @@
#include "../../dxgi/dxgi_interfaces.h"
const GUID IDXGIVkAdapter::guid = {0x907bf281,0xea3c,0x43b4,{0xa8,0xe4,0x9f,0x23,0x11,0x07,0xb4,0xff}};
const GUID IDXGIVkMonitorInfo::guid = {0xc06a236f,0x5be3,0x448a,{0x89,0x43,0x89,0xc6,0x11,0xc0,0xc2,0xc1}};
const GUID IDXGIVkInteropDevice::guid = {0xe2ef5fa5,0xdc21,0x4af7,{0x90,0xc4,0xf6,0x7e,0xf6,0xa0,0x93,0x23}};
const GUID IDXGIVkInteropSurface::guid = {0x5546cf8c,0x77e7,0x4341,{0xb0,0x5d,0x8d,0x4d,0x50,0x00,0xe7,0x7d}};
const GUID IDXGIVkSwapChain::guid = {0x104001a6,0x7f36,0x4957,{0xb9,0x32,0x86,0xad,0xe9,0x56,0x7d,0x91}};