2017-10-11 03:09:04 +02:00
|
|
|
#pragma once
|
|
|
|
|
2017-12-04 11:33:04 +01:00
|
|
|
#include <initializer_list>
|
2017-10-11 03:09:04 +02:00
|
|
|
#include <memory>
|
2017-12-04 11:33:04 +01:00
|
|
|
#include <unordered_map>
|
2017-10-11 03:09:04 +02:00
|
|
|
#include <vector>
|
2018-03-17 00:40:26 +01:00
|
|
|
#include <string>
|
2017-10-11 03:09:04 +02:00
|
|
|
|
|
|
|
#include <dxvk_adapter.h>
|
|
|
|
|
2017-10-11 15:31:36 +02:00
|
|
|
#include "dxgi_interfaces.h"
|
2018-04-12 13:38:22 +02:00
|
|
|
#include "dxgi_output.h"
|
2017-10-11 03:09:04 +02:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class DxgiFactory;
|
|
|
|
class DxgiOutput;
|
|
|
|
|
2018-03-28 19:06:00 +02:00
|
|
|
class DxgiAdapter : public DxgiObject<IDXGIVkAdapter> {
|
2017-10-11 03:09:04 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxgiAdapter(
|
|
|
|
DxgiFactory* factory,
|
|
|
|
const Rc<DxvkAdapter>& adapter);
|
|
|
|
~DxgiAdapter();
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(
|
2018-04-12 13:38:22 +02:00
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetParent(
|
2018-04-12 13:38:22 +02:00
|
|
|
REFIID riid,
|
|
|
|
void** ppParent) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE CheckInterfaceSupport(
|
2018-04-12 13:38:22 +02:00
|
|
|
REFGUID InterfaceName,
|
|
|
|
LARGE_INTEGER* pUMDVersion) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE EnumOutputs(
|
2018-04-12 13:38:22 +02:00
|
|
|
UINT Output,
|
|
|
|
IDXGIOutput** ppOutput) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetDesc(
|
2018-04-12 13:38:22 +02:00
|
|
|
DXGI_ADAPTER_DESC* pDesc) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetDesc1(
|
2018-04-12 13:38:22 +02:00
|
|
|
DXGI_ADAPTER_DESC1* pDesc) final;
|
2017-11-26 16:12:11 +01:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
Rc<DxvkAdapter> STDMETHODCALLTYPE GetDXVKAdapter() final;
|
2017-10-11 15:31:36 +02:00
|
|
|
|
2018-03-28 18:58:53 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE CreateDevice(
|
2018-03-28 21:24:52 +02:00
|
|
|
IDXGIObject* pContainer,
|
2018-03-28 18:58:53 +02:00
|
|
|
const VkPhysicalDeviceFeatures* pFeatures,
|
2018-03-28 21:24:52 +02:00
|
|
|
IDXGIVkDevice** ppDevice) final;
|
2018-03-28 18:58:53 +02:00
|
|
|
|
2018-04-12 15:36:01 +02:00
|
|
|
DXGI_VK_FORMAT_INFO STDMETHODCALLTYPE LookupFormat(
|
2018-04-12 17:49:14 +02:00
|
|
|
DXGI_FORMAT Format,
|
|
|
|
DXGI_VK_FORMAT_MODE Mode) final;
|
2017-12-04 11:33:04 +01:00
|
|
|
|
2018-01-13 18:56:15 +01:00
|
|
|
HRESULT GetOutputFromMonitor(
|
2018-04-12 13:38:22 +02:00
|
|
|
HMONITOR Monitor,
|
|
|
|
IDXGIOutput** ppOutput);
|
|
|
|
|
|
|
|
HRESULT GetOutputData(
|
|
|
|
HMONITOR Monitor,
|
|
|
|
DXGI_VK_OUTPUT_DATA* pOutputData);
|
|
|
|
|
|
|
|
HRESULT SetOutputData(
|
|
|
|
HMONITOR Monitor,
|
|
|
|
const DXGI_VK_OUTPUT_DATA* pOutputData);
|
2018-01-13 18:56:15 +01:00
|
|
|
|
2017-10-11 03:09:04 +02:00
|
|
|
private:
|
|
|
|
|
2018-04-12 17:49:14 +02:00
|
|
|
using OutputMap = std::unordered_map<HMONITOR, DXGI_VK_OUTPUT_DATA>;
|
2017-12-19 14:47:35 +01:00
|
|
|
|
2017-10-11 15:31:36 +02:00
|
|
|
Com<DxgiFactory> m_factory;
|
|
|
|
Rc<DxvkAdapter> m_adapter;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2018-04-12 13:38:22 +02:00
|
|
|
std::mutex m_outputMutex;
|
|
|
|
OutputMap m_outputData;
|
|
|
|
|
2017-10-11 03:09:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|