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

91 lines
2.4 KiB
C
Raw Normal View History

2017-10-11 03:09:04 +02:00
#pragma once
#include <initializer_list>
2017-10-11 03:09:04 +02:00
#include <memory>
#include <unordered_map>
2017-10-11 03:09:04 +02:00
#include <vector>
#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(
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
2017-12-20 14:54:24 +01:00
DxgiFormatInfo STDMETHODCALLTYPE LookupFormat(
DXGI_FORMAT format, DxgiFormatMode mode) final;
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-10-11 15:31:36 +02:00
Com<DxgiFactory> m_factory;
Rc<DxvkAdapter> m_adapter;
2017-10-11 03:09:04 +02:00
FormatMap m_colorFormats;
FormatMap m_depthFormats;
void AddColorFormat(
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,
VkComponentMapping swizzle);
void AddDepthFormat(
DXGI_FORMAT srcFormat,
2017-12-20 14:54:24 +01:00
VkFormat dstFormat,
VkImageAspectFlags srvAspect);
void SetupFormatTable();
bool HasFormatSupport(
VkFormat format,
VkFormatFeatureFlags features) const;
2017-10-11 03:09:04 +02:00
};
}