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"
|
2017-10-11 03:09:04 +02:00
|
|
|
#include "dxgi_object.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class DxgiFactory;
|
|
|
|
class DxgiOutput;
|
|
|
|
|
2017-11-27 15:51:53 +01:00
|
|
|
class DxgiAdapter : public DxgiObject<IDXGIAdapterPrivate> {
|
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(
|
2017-10-11 03:09:04 +02:00
|
|
|
REFIID riid,
|
|
|
|
void **ppvObject) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetParent(
|
2017-10-11 03:09:04 +02:00
|
|
|
REFIID riid,
|
|
|
|
void **ppParent) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE CheckInterfaceSupport(
|
2017-10-11 03:09:04 +02:00
|
|
|
REFGUID InterfaceName,
|
|
|
|
LARGE_INTEGER *pUMDVersion) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE EnumOutputs(
|
2017-10-11 03:09:04 +02:00
|
|
|
UINT Output,
|
|
|
|
IDXGIOutput **ppOutput) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetDesc(
|
2017-10-11 03:09:04 +02:00
|
|
|
DXGI_ADAPTER_DESC *pDesc) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetDesc1(
|
2017-11-26 16:12:11 +01:00
|
|
|
DXGI_ADAPTER_DESC1 *pDesc) final;
|
|
|
|
|
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(
|
|
|
|
const VkPhysicalDeviceFeatures* pFeatures,
|
|
|
|
IDXGIDevicePrivate** ppDevice) final;
|
|
|
|
|
2017-12-20 14:54:24 +01:00
|
|
|
DxgiFormatInfo STDMETHODCALLTYPE LookupFormat(
|
2017-12-19 14:47:35 +01:00
|
|
|
DXGI_FORMAT format, DxgiFormatMode mode) final;
|
2017-12-04 11:33:04 +01:00
|
|
|
|
2018-01-13 18:56:15 +01:00
|
|
|
HRESULT GetOutputFromMonitor(
|
|
|
|
HMONITOR Monitor,
|
|
|
|
IDXGIOutput** ppOutput);
|
|
|
|
|
2017-10-11 03:09:04 +02:00
|
|
|
private:
|
|
|
|
|
2017-12-20 14:54:24 +01:00
|
|
|
using FormatMap = std::unordered_map<DXGI_FORMAT, DxgiFormatInfo>;
|
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
|
|
|
|
2017-12-19 14:47:35 +01:00
|
|
|
FormatMap m_colorFormats;
|
|
|
|
FormatMap m_depthFormats;
|
2017-12-04 11:33:04 +01:00
|
|
|
|
2018-01-28 18:06:08 +01:00
|
|
|
void AddColorFormatTypeless(
|
2017-12-09 14:41:37 +01:00
|
|
|
DXGI_FORMAT srcFormat,
|
|
|
|
VkFormat dstFormat);
|
|
|
|
|
2017-12-20 14:54:24 +01:00
|
|
|
void AddColorFormat(
|
|
|
|
DXGI_FORMAT srcFormat,
|
|
|
|
VkFormat dstFormat,
|
2018-01-28 18:06:08 +01:00
|
|
|
VkComponentMapping swizzle = {
|
|
|
|
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY,
|
|
|
|
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY });
|
|
|
|
|
|
|
|
void AddDepthFormatTypeless(
|
|
|
|
DXGI_FORMAT srcFormat,
|
|
|
|
VkFormat dstFormat);
|
2017-12-20 14:54:24 +01:00
|
|
|
|
2017-12-19 14:47:35 +01:00
|
|
|
void AddDepthFormat(
|
2017-12-04 11:33:04 +01:00
|
|
|
DXGI_FORMAT srcFormat,
|
2017-12-20 14:54:24 +01:00
|
|
|
VkFormat dstFormat,
|
|
|
|
VkImageAspectFlags srvAspect);
|
2017-12-04 11:33:04 +01:00
|
|
|
|
|
|
|
void SetupFormatTable();
|
|
|
|
|
2017-10-11 03:09:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|