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

[dxgi] Renamed private DXGI interfaces

This commit is contained in:
Philip Rebohle 2018-03-28 19:06:00 +02:00
parent 410cde3f17
commit 8d3dcba8d5
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
13 changed files with 49 additions and 49 deletions

View File

@ -16,7 +16,7 @@
namespace dxvk {
D3D11Device::D3D11Device(
IDXGIDevicePrivate* dxgiDevice,
IDXGIVkDevice* dxgiDevice,
D3D_FEATURE_LEVEL featureLevel,
UINT featureFlags)
: m_dxgiDevice (dxgiDevice),
@ -30,7 +30,7 @@ namespace dxvk {
Com<IDXGIAdapter> adapter;
if (FAILED(m_dxgiDevice->GetAdapter(&adapter))
|| FAILED(adapter->QueryInterface(__uuidof(IDXGIAdapterPrivate),
|| FAILED(adapter->QueryInterface(__uuidof(IDXGIVkAdapter),
reinterpret_cast<void**>(&m_dxgiAdapter))))
throw DxvkError("D3D11Device: Failed to query adapter");
@ -62,10 +62,10 @@ namespace dxvk {
if (riid == __uuidof(IDXGIDevice)
|| riid == __uuidof(IDXGIDevice1)
|| riid == __uuidof(IDXGIDevice2)
|| riid == __uuidof(IDXGIDevicePrivate))
|| riid == __uuidof(IDXGIVkDevice))
return m_dxgiDevice->QueryInterface(riid, ppvObject);
if (riid == __uuidof(IDXGIPresentDevicePrivate))
if (riid == __uuidof(IDXGIVkPresenter))
return m_presentDevice->QueryInterface(riid, ppvObject);
if (riid == __uuidof(ID3D11Debug))

View File

@ -35,7 +35,7 @@ namespace dxvk {
public:
D3D11Device(
IDXGIDevicePrivate* dxgiDevice,
IDXGIVkDevice* dxgiDevice,
D3D_FEATURE_LEVEL featureLevel,
UINT featureFlags);
~D3D11Device();
@ -298,8 +298,8 @@ namespace dxvk {
private:
const Com<IDXGIDevicePrivate> m_dxgiDevice;
Com<IDXGIAdapterPrivate> m_dxgiAdapter;
const Com<IDXGIVkDevice> m_dxgiDevice;
Com<IDXGIVkAdapter> m_dxgiAdapter;
const Com<D3D11PresentDevice> m_presentDevice;
const D3D_FEATURE_LEVEL m_featureLevel;

View File

@ -25,7 +25,7 @@ extern "C" {
D3D_FEATURE_LEVEL *pFeatureLevel,
ID3D11DeviceContext **ppImmediateContext) {
Com<IDXGIAdapter> dxgiAdapter = pAdapter;
Com<IDXGIAdapterPrivate> dxvkAdapter = nullptr;
Com<IDXGIVkAdapter> dxvkAdapter = nullptr;
if (dxgiAdapter == nullptr) {
// We'll treat everything as hardware, even if the
@ -58,7 +58,7 @@ extern "C" {
// The adapter must obviously be a DXVK-compatible adapter so
// that we can create a DXVK-compatible DXGI device from it.
if (FAILED(dxgiAdapter->QueryInterface(__uuidof(IDXGIAdapterPrivate),
if (FAILED(dxgiAdapter->QueryInterface(__uuidof(IDXGIVkAdapter),
reinterpret_cast<void**>(&dxvkAdapter)))) {
Logger::err("D3D11CreateDevice: Adapter is not a DXVK adapter");
return E_INVALIDARG;
@ -110,7 +110,7 @@ extern "C" {
if (ppDevice == nullptr && ppImmediateContext == nullptr)
return S_FALSE;
Com<IDXGIDevicePrivate> dxvkDevice = nullptr;
Com<IDXGIVkDevice> dxvkDevice = nullptr;
const VkPhysicalDeviceFeatures deviceFeatures
= D3D11Device::GetDeviceFeatures(adapter, fl);

View File

@ -4,12 +4,12 @@
namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D11PresentBackBuffer::QueryInterface(REFIID riid, void** ppvObject) {
HRESULT STDMETHODCALLTYPE D3D11VkBackBuffer::QueryInterface(REFIID riid, void** ppvObject) {
return m_texture->QueryInterface(riid, ppvObject);
}
Rc<DxvkImage> D3D11PresentBackBuffer::GetDXVKImage() {
Rc<DxvkImage> D3D11VkBackBuffer::GetDXVKImage() {
return m_texture->GetCommonTexture()->GetImage();
}
@ -22,14 +22,14 @@ namespace dxvk {
REFIID riid,
void** ppvObject) {
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
COM_QUERY_IFACE(riid, ppvObject, IDXGIPresentDevicePrivate);
COM_QUERY_IFACE(riid, ppvObject, IDXGIVkPresenter);
return m_device->QueryInterface(riid, ppvObject);
}
HRESULT STDMETHODCALLTYPE D3D11PresentDevice::CreateSwapChainBackBuffer(
const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
IDXGIPresentBackBuffer** ppInterface) {
IDXGIVkBackBuffer** ppInterface) {
D3D11_COMMON_TEXTURE_DESC desc;
desc.Width = pSwapChainDesc->BufferDesc.Width;
desc.Height = pSwapChainDesc->BufferDesc.Height;
@ -48,7 +48,7 @@ namespace dxvk {
desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS;
try {
*ppInterface = ref(new D3D11PresentBackBuffer(
*ppInterface = ref(new D3D11VkBackBuffer(
new D3D11Texture2D(m_device, &desc)));
return S_OK;
} catch (const DxvkError& e) {

View File

@ -10,11 +10,11 @@ namespace dxvk {
class D3D11Device;
class D3D11PresentBackBuffer : public ComObject<IDXGIPresentBackBuffer> {
class D3D11VkBackBuffer : public ComObject<IDXGIVkBackBuffer> {
public:
D3D11PresentBackBuffer(D3D11Texture2D* pTexture)
D3D11VkBackBuffer(D3D11Texture2D* pTexture)
: m_texture(pTexture) { }
HRESULT STDMETHODCALLTYPE QueryInterface(
@ -30,7 +30,7 @@ namespace dxvk {
};
class D3D11PresentDevice : public ComObject<IDXGIPresentDevicePrivate> {
class D3D11PresentDevice : public ComObject<IDXGIVkPresenter> {
public:
@ -43,7 +43,7 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE CreateSwapChainBackBuffer(
const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
IDXGIPresentBackBuffer** ppInterface) final;
IDXGIVkBackBuffer** ppInterface) final;
HRESULT STDMETHODCALLTYPE FlushRenderingCommands() final;

View File

@ -32,7 +32,7 @@ namespace dxvk {
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter);
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter1);
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapterPrivate);
COM_QUERY_IFACE(riid, ppvObject, IDXGIVkAdapter);
Logger::warn("DxgiAdapter::QueryInterface: Unknown interface query");
Logger::warn(str::format(riid));
@ -158,7 +158,7 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE DxgiAdapter::CreateDevice(
const VkPhysicalDeviceFeatures* pFeatures,
IDXGIDevicePrivate** ppDevice) {
IDXGIVkDevice** ppDevice) {
try {
*ppDevice = ref(new dxvk::DxgiDevice(this, pFeatures));
return S_OK;

View File

@ -16,7 +16,7 @@ namespace dxvk {
class DxgiFactory;
class DxgiOutput;
class DxgiAdapter : public DxgiObject<IDXGIAdapterPrivate> {
class DxgiAdapter : public DxgiObject<IDXGIVkAdapter> {
public:
@ -51,7 +51,7 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE CreateDevice(
const VkPhysicalDeviceFeatures* pFeatures,
IDXGIDevicePrivate** ppDevice) final;
IDXGIVkDevice** ppDevice) final;
DxgiFormatInfo STDMETHODCALLTYPE LookupFormat(
DXGI_FORMAT format, DxgiFormatMode mode) final;

View File

@ -4,7 +4,7 @@
namespace dxvk {
DxgiDevice::DxgiDevice(
IDXGIAdapterPrivate* pAdapter,
IDXGIVkAdapter* pAdapter,
const VkPhysicalDeviceFeatures* pFeatures)
: m_adapter(pAdapter) {
m_device = m_adapter->GetDXVKAdapter()->createDevice(*pFeatures);
@ -22,7 +22,7 @@ namespace dxvk {
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice);
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice1);
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice2);
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevicePrivate);
COM_QUERY_IFACE(riid, ppvObject, IDXGIVkDevice);
if (m_layer != nullptr)
return m_layer->QueryInterface(riid, ppvObject);

View File

@ -9,12 +9,12 @@ namespace dxvk {
class DxgiFactory;
class DxgiDevice : public DxgiObject<IDXGIDevicePrivate> {
class DxgiDevice : public DxgiObject<IDXGIVkDevice> {
public:
DxgiDevice(
IDXGIAdapterPrivate* pAdapter,
IDXGIVkAdapter* pAdapter,
const VkPhysicalDeviceFeatures* pFeatures);
~DxgiDevice();
@ -73,7 +73,7 @@ namespace dxvk {
private:
Com<IDXGIAdapterPrivate> m_adapter;
Com<IDXGIVkAdapter> m_adapter;
Rc<DxvkDevice> m_device;
IUnknown* m_layer = nullptr;

View File

@ -59,7 +59,7 @@ namespace dxvk {
* this interface.
*/
MIDL_INTERFACE("7a622cf6-627a-46b2-b52f-360ef3da831c")
IDXGIDevicePrivate : public IDXGIDevice2 {
IDXGIVkDevice : public IDXGIDevice2 {
static const GUID guid;
virtual void STDMETHODCALLTYPE SetDeviceLayer(
@ -77,7 +77,7 @@ IDXGIDevicePrivate : public IDXGIDevice2 {
* this interface.
*/
MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff")
IDXGIAdapterPrivate : public IDXGIAdapter1 {
IDXGIVkAdapter : public IDXGIAdapter1 {
static const GUID guid;
virtual dxvk::Rc<dxvk::DxvkAdapter> STDMETHODCALLTYPE GetDXVKAdapter() = 0;
@ -92,7 +92,7 @@ IDXGIAdapterPrivate : public IDXGIAdapter1 {
*/
virtual HRESULT STDMETHODCALLTYPE CreateDevice(
const VkPhysicalDeviceFeatures* pFeatures,
IDXGIDevicePrivate** ppDevice) = 0;
IDXGIVkDevice** ppDevice) = 0;
/**
* \brief Maps a DXGI format to a compatible Vulkan format
@ -119,7 +119,7 @@ IDXGIAdapterPrivate : public IDXGIAdapter1 {
* a texture object specified by the client API.
*/
MIDL_INTERFACE("5679becd-8547-4d93-96a1-e61a1ce7ef37")
IDXGIPresentBackBuffer : public IUnknown {
IDXGIVkBackBuffer : public IUnknown {
static const GUID guid;
virtual dxvk::Rc<dxvk::DxvkImage> GetDXVKImage() = 0;
@ -134,7 +134,7 @@ IDXGIPresentBackBuffer : public IUnknown {
* back buffer interface.
*/
MIDL_INTERFACE("79352328-16f2-4f81-9746-9c2e2ccd43cf")
IDXGIPresentDevicePrivate : public IUnknown {
IDXGIVkPresenter : public IUnknown {
static const GUID guid;
/**
@ -144,7 +144,7 @@ IDXGIPresentDevicePrivate : public IUnknown {
*/
virtual HRESULT STDMETHODCALLTYPE CreateSwapChainBackBuffer(
const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
IDXGIPresentBackBuffer** ppBackBuffer) = 0;
IDXGIVkBackBuffer** ppBackBuffer) = 0;
/**
* \brief Flushes the immediate context
@ -169,13 +169,13 @@ IDXGIPresentDevicePrivate : public IUnknown {
};
#ifdef _MSC_VER
struct __declspec(uuid("907bf281-ea3c-43b4-a8e4-9f231107b4ff")) IDXGIAdapterPrivate;
struct __declspec(uuid("7a622cf6-627a-46b2-b52f-360ef3da831c")) IDXGIDevicePrivate;
struct __declspec(uuid("5679becd-8547-4d93-96a1-e61a1ce7ef37")) IDXGIPresentBackBuffer;
struct __declspec(uuid("79352328-16f2-4f81-9746-9c2e2ccd43cf")) IDXGIPresentDevicePrivate;
struct __declspec(uuid("907bf281-ea3c-43b4-a8e4-9f231107b4ff")) IDXGIVkAdapter;
struct __declspec(uuid("7a622cf6-627a-46b2-b52f-360ef3da831c")) IDXGIVkDevice;
struct __declspec(uuid("5679becd-8547-4d93-96a1-e61a1ce7ef37")) IDXGIVkBackBuffer;
struct __declspec(uuid("79352328-16f2-4f81-9746-9c2e2ccd43cf")) IDXGIVkPresenter;
#else
DXVK_DEFINE_GUID(IDXGIAdapterPrivate);
DXVK_DEFINE_GUID(IDXGIDevicePrivate);
DXVK_DEFINE_GUID(IDXGIPresentBackBuffer);
DXVK_DEFINE_GUID(IDXGIPresentDevicePrivate);
DXVK_DEFINE_GUID(IDXGIVkAdapter);
DXVK_DEFINE_GUID(IDXGIVkDevice);
DXVK_DEFINE_GUID(IDXGIVkBackBuffer);
DXVK_DEFINE_GUID(IDXGIVkPresenter);
#endif

View File

@ -13,7 +13,7 @@ namespace dxvk {
// Retrieve a device pointer that allows us to
// communicate with the underlying D3D device
if (FAILED(pDevice->QueryInterface(__uuidof(IDXGIPresentDevicePrivate),
if (FAILED(pDevice->QueryInterface(__uuidof(IDXGIVkPresenter),
reinterpret_cast<void**>(&m_presentDevice))))
throw DxvkError("DxgiSwapChain::DxgiSwapChain: Invalid device");

View File

@ -93,13 +93,13 @@ namespace dxvk {
Com<DxgiFactory> m_factory;
Com<DxgiAdapter> m_adapter;
Com<DxgiDevice> m_device;
Com<IDXGIPresentDevicePrivate> m_presentDevice;
Com<IDXGIVkPresenter> m_presentDevice;
DXGI_SWAP_CHAIN_DESC m_desc;
DXGI_FRAME_STATISTICS m_stats;
Rc<DxgiPresenter> m_presenter;
Com<IDXGIPresentBackBuffer> m_backBuffer;
Com<IDXGIVkBackBuffer> m_backBuffer;
WindowState m_windowState;

View File

@ -4,10 +4,10 @@
#include "../../dxgi/dxgi_interfaces.h"
const GUID IDXGIAdapterPrivate::guid = {0x907bf281,0xea3c,0x43b4,{0xa8,0xe4,0x9f,0x23,0x11,0x07,0xb4,0xff}};
const GUID IDXGIDevicePrivate::guid = {0x7a622cf6,0x627a,0x46b2,{0xb5,0x2f,0x36,0x0e,0xf3,0xda,0x83,0x1c}};
const GUID IDXGIPresentBackBuffer::guid = {0x5679becd,0x8547,0x4d93,{0x96,0xa1,0xe6,0x1a,0x1c,0xe7,0xef,0x37}};
const GUID IDXGIPresentDevicePrivate::guid = {0x79352328,0x16f2,0x4f81,{0x97,0x46,0x9c,0x2e,0x2c,0xcd,0x43,0xcf}};
const GUID IDXGIVkAdapter::guid = {0x907bf281,0xea3c,0x43b4,{0xa8,0xe4,0x9f,0x23,0x11,0x07,0xb4,0xff}};
const GUID IDXGIVkDevice::guid = {0x7a622cf6,0x627a,0x46b2,{0xb5,0x2f,0x36,0x0e,0xf3,0xda,0x83,0x1c}};
const GUID IDXGIVkBackBuffer::guid = {0x5679becd,0x8547,0x4d93,{0x96,0xa1,0xe6,0x1a,0x1c,0xe7,0xef,0x37}};
const GUID IDXGIVkPresenter::guid = {0x79352328,0x16f2,0x4f81,{0x97,0x46,0x9c,0x2e,0x2c,0xcd,0x43,0xcf}};
std::ostream& operator << (std::ostream& os, REFIID guid) {
os << std::hex << std::setfill('0')