diff --git a/src/d3d11/d3d11_buffer.cpp b/src/d3d11/d3d11_buffer.cpp index e10a5fe4b..5b8ea4e92 100644 --- a/src/d3d11/d3d11_buffer.cpp +++ b/src/d3d11/d3d11_buffer.cpp @@ -4,10 +4,12 @@ namespace dxvk { D3D11Buffer::D3D11Buffer( - D3D11Device* device, - const D3D11_BUFFER_DESC& desc) - : m_device(device), m_desc(desc), - m_buffer(this->createBuffer()) { + D3D11Device* device, + IDXGIImageResourcePrivate* resource, + const D3D11_BUFFER_DESC& desc) + : m_device (device), + m_resource(resource), + m_desc (desc) { } @@ -23,6 +25,10 @@ namespace dxvk { COM_QUERY_IFACE(riid, ppvObject, ID3D11Resource); COM_QUERY_IFACE(riid, ppvObject, ID3D11Buffer); + if (riid == __uuidof(IDXGIResource) + || riid == __uuidof(IDXGIBufferResourcePrivate)) + return m_resource->QueryInterface(riid, ppvObject); + Logger::warn("D3D11Buffer::QueryInterface: Unknown interface query"); return E_NOINTERFACE; } @@ -42,93 +48,4 @@ namespace dxvk { *pDesc = m_desc; } - - Rc D3D11Buffer::createBuffer() { - VkMemoryPropertyFlags memoryType = 0; - - DxvkBufferCreateInfo info; - info.size = m_desc.ByteWidth; - info.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT - | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; - info.stages = VK_PIPELINE_STAGE_TRANSFER_BIT; - info.access = VK_ACCESS_TRANSFER_WRITE_BIT - | VK_ACCESS_TRANSFER_READ_BIT; - - switch (m_desc.Usage) { - case D3D11_USAGE_DEFAULT: - case D3D11_USAGE_IMMUTABLE: - memoryType |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - break; - - case D3D11_USAGE_DYNAMIC: - memoryType |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT - | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; - break; - - case D3D11_USAGE_STAGING: - memoryType |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT - | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT - | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; - break; - } - - if (m_desc.BindFlags & D3D11_BIND_VERTEX_BUFFER) { - info.usage |= VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; - info.stages |= VK_PIPELINE_STAGE_VERTEX_INPUT_BIT; - info.access |= VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT; - } - - if (m_desc.BindFlags & D3D11_BIND_INDEX_BUFFER) { - info.usage |= VK_BUFFER_USAGE_INDEX_BUFFER_BIT; - info.stages |= VK_PIPELINE_STAGE_VERTEX_INPUT_BIT; - info.access |= VK_ACCESS_INDEX_READ_BIT; - } - - if (m_desc.BindFlags & (D3D11_BIND_CONSTANT_BUFFER & D3D11_BIND_SHADER_RESOURCE)) { - info.usage |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT - | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT; - info.stages |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT - | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT - | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT - | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT - | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT - | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; - info.access |= VK_ACCESS_SHADER_READ_BIT; - } - - if (m_desc.BindFlags & D3D11_BIND_STREAM_OUTPUT) { - info.usage |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT - | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; - info.stages |= VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT; - info.access |= VK_ACCESS_SHADER_WRITE_BIT; - } - - if (m_desc.BindFlags & D3D11_BIND_UNORDERED_ACCESS) { - info.usage |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT - | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; - info.stages |= VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT - | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; - info.access |= VK_ACCESS_SHADER_READ_BIT - | VK_ACCESS_SHADER_WRITE_BIT; - } - - if (m_desc.CPUAccessFlags & D3D11_CPU_ACCESS_WRITE) { - info.stages |= VK_PIPELINE_STAGE_HOST_BIT; - info.access |= VK_ACCESS_HOST_WRITE_BIT; - } - - if (m_desc.CPUAccessFlags & D3D11_CPU_ACCESS_READ) { - info.stages |= VK_PIPELINE_STAGE_HOST_BIT; - info.access |= VK_ACCESS_HOST_READ_BIT; - } - - if (m_desc.MiscFlags & D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS) { - info.usage |= VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT; - info.stages |= VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT; - info.access |= VK_ACCESS_INDIRECT_COMMAND_READ_BIT; - } - - return m_device->GetDXVKDevice()->createBuffer(info, memoryType); - } - } diff --git a/src/d3d11/d3d11_buffer.h b/src/d3d11/d3d11_buffer.h index 08b685448..19d12c642 100644 --- a/src/d3d11/d3d11_buffer.h +++ b/src/d3d11/d3d11_buffer.h @@ -3,6 +3,7 @@ #include #include "d3d11_device_child.h" +#include "d3d11_interfaces.h" namespace dxvk { @@ -14,8 +15,9 @@ namespace dxvk { public: D3D11Buffer( - D3D11Device* device, - const D3D11_BUFFER_DESC& desc); + D3D11Device* device, + IDXGIImageResourcePrivate* resource, + const D3D11_BUFFER_DESC& desc); ~D3D11Buffer(); HRESULT QueryInterface( @@ -33,12 +35,9 @@ namespace dxvk { private: - Com m_device; - - D3D11_BUFFER_DESC m_desc; - Rc m_buffer; - - Rc createBuffer(); + Com m_device; + Com m_resource; + D3D11_BUFFER_DESC m_desc; }; diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 4b6a97a87..aae531260 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -3,6 +3,7 @@ #include "d3d11_buffer.h" #include "d3d11_context.h" #include "d3d11_device.h" +#include "d3d11_present.h" #include "d3d11_texture.h" #include "d3d11_view.h" @@ -12,17 +13,21 @@ namespace dxvk { IDXGIDevicePrivate* dxgiDevice, D3D_FEATURE_LEVEL featureLevel, UINT featureFlags) - : m_dxgiDevice (dxgiDevice), - m_featureLevel(featureLevel), - m_featureFlags(featureFlags), - m_dxvkDevice (m_dxgiDevice->GetDXVKDevice()), - m_dxvkAdapter (m_dxvkDevice->adapter()) { + : m_dxgiDevice (dxgiDevice), + m_presentDevice (ref(new D3D11PresentDevice())), + m_featureLevel (featureLevel), + m_featureFlags (featureFlags), + m_dxvkDevice (m_dxgiDevice->GetDXVKDevice()), + m_dxvkAdapter (m_dxvkDevice->adapter()) { m_dxgiDevice->SetDeviceLayer(this); + m_presentDevice->SetDeviceLayer(this); + m_context = new D3D11DeviceContext(this, m_dxvkDevice); } D3D11Device::~D3D11Device() { + m_presentDevice->SetDeviceLayer(nullptr); m_dxgiDevice->SetDeviceLayer(nullptr); } @@ -30,12 +35,14 @@ namespace dxvk { HRESULT D3D11Device::QueryInterface(REFIID riid, void** ppvObject) { COM_QUERY_IFACE(riid, ppvObject, IUnknown); COM_QUERY_IFACE(riid, ppvObject, ID3D11Device); - COM_QUERY_IFACE(riid, ppvObject, ID3D11DevicePrivate); if (riid == __uuidof(IDXGIDevice) || riid == __uuidof(IDXGIDevicePrivate)) return m_dxgiDevice->QueryInterface(riid, ppvObject); + if (riid == __uuidof(IDXGIPresentDevicePrivate)) + return m_presentDevice->QueryInterface(riid, ppvObject); + Logger::warn("D3D11Device::QueryInterface: Unknown interface query"); return E_NOINTERFACE; } @@ -390,39 +397,6 @@ namespace dxvk { } - HRESULT D3D11Device::WrapSwapChainBackBuffer( - IDXGIImageResourcePrivate* pResource, - const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, - IUnknown** ppInterface) { - D3D11_TEXTURE2D_DESC desc; - desc.Width = pSwapChainDesc->BufferDesc.Width; - desc.Height = pSwapChainDesc->BufferDesc.Height; - desc.MipLevels = 1; - desc.ArraySize = 1; - desc.Format = pSwapChainDesc->BufferDesc.Format; - desc.SampleDesc = pSwapChainDesc->SampleDesc; - desc.Usage = D3D11_USAGE_DEFAULT; - desc.BindFlags = D3D11_BIND_RENDER_TARGET - | D3D11_BIND_SHADER_RESOURCE; - desc.CPUAccessFlags = 0; - desc.MiscFlags = 0; - - *ppInterface = ref(new D3D11Texture2D(this, pResource, desc)); - return S_OK; - } - - - HRESULT D3D11Device::FlushRenderingCommands() { - m_context->Flush(); - return S_OK; - } - - - Rc D3D11Device::GetDXVKDevice() { - return m_dxvkDevice; - } - - bool D3D11Device::CheckFeatureLevelSupport( D3D_FEATURE_LEVEL featureLevel) { return featureLevel <= D3D_FEATURE_LEVEL_11_0; diff --git a/src/d3d11/d3d11_device.h b/src/d3d11/d3d11_device.h index c9b4360fd..35320ad21 100644 --- a/src/d3d11/d3d11_device.h +++ b/src/d3d11/d3d11_device.h @@ -11,8 +11,9 @@ namespace dxvk { class DxgiAdapter; class D3D11DeviceContext; + class D3D11PresentDevice; - class D3D11Device : public ComObject { + class D3D11Device : public ComObject { public: @@ -215,14 +216,9 @@ namespace dxvk { UINT GetExceptionMode() final; - HRESULT WrapSwapChainBackBuffer( - IDXGIImageResourcePrivate* pResource, - const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, - IUnknown** ppInterface) final; - - HRESULT FlushRenderingCommands() final; - - Rc GetDXVKDevice() final; + Rc GetDXVKDevice() { + return m_dxvkDevice; + } static bool CheckFeatureLevelSupport( D3D_FEATURE_LEVEL featureLevel); @@ -230,6 +226,8 @@ namespace dxvk { private: const Com m_dxgiDevice; + const Com m_presentDevice; + const D3D_FEATURE_LEVEL m_featureLevel; const UINT m_featureFlags; diff --git a/src/d3d11/d3d11_interfaces.h b/src/d3d11/d3d11_interfaces.h index 9580afcdc..82ccb797b 100644 --- a/src/d3d11/d3d11_interfaces.h +++ b/src/d3d11/d3d11_interfaces.h @@ -6,48 +6,3 @@ #include "../dxvk/dxvk_device.h" -/** - * \brief Private device interface - * - * This interface is used by \ref DxgiSwapChain - * in order to communicate with the device. - */ -MIDL_INTERFACE("ab2a2a58-d2ac-4ca0-9ad9-a260cafa00c8") -ID3D11DevicePrivate : public ID3D11Device { - static const GUID guid; - - /** - * \brief Wraps swap chain image into a texture interface - * - * Creates an interface to the back buffer image of a - * swap chain. This interface will be returned by the - * swap chain's \c GetBuffer method. - * \param [in] image Image to wrap - * \param [in] pSwapChainDesc Swap chain properties - * \param [in] ppInterface Target interface - * \returns \c S_OK on success - */ - virtual HRESULT WrapSwapChainBackBuffer( - IDXGIImageResourcePrivate* pResource, - const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, - IUnknown** ppInterface) = 0; - - /** - * \brief Flushes the immediate context - * - * Used by the swap chain's \c Present method to - * ensure that all rendering commands get dispatched - * before presenting the swap chain's back buffer. - * \returns \c S_OK on success - */ - virtual HRESULT FlushRenderingCommands() = 0; - - /** - * \brief Underlying DXVK device - * \returns DXVK device handle - */ - virtual dxvk::Rc GetDXVKDevice() = 0; -}; - - -DXVK_DEFINE_GUID(ID3D11DevicePrivate); \ No newline at end of file diff --git a/src/d3d11/d3d11_present.cpp b/src/d3d11/d3d11_present.cpp new file mode 100644 index 000000000..107e29284 --- /dev/null +++ b/src/d3d11/d3d11_present.cpp @@ -0,0 +1,56 @@ +#include "d3d11_device.h" +#include "d3d11_present.h" +#include "d3d11_texture.h" + +namespace dxvk { + + D3D11PresentDevice:: D3D11PresentDevice() { } + D3D11PresentDevice::~D3D11PresentDevice() { } + + + HRESULT D3D11PresentDevice::QueryInterface( + REFIID riid, + void** ppvObject) { + COM_QUERY_IFACE(riid, ppvObject, IUnknown); + COM_QUERY_IFACE(riid, ppvObject, IDXGIPresentDevicePrivate); + return m_device->QueryInterface(riid, ppvObject); + } + + + HRESULT D3D11PresentDevice::WrapSwapChainBackBuffer( + IDXGIImageResourcePrivate* pResource, + const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, + IUnknown** ppInterface) { + D3D11_TEXTURE2D_DESC desc; + desc.Width = pSwapChainDesc->BufferDesc.Width; + desc.Height = pSwapChainDesc->BufferDesc.Height; + desc.MipLevels = 1; + desc.ArraySize = 1; + desc.Format = pSwapChainDesc->BufferDesc.Format; + desc.SampleDesc = pSwapChainDesc->SampleDesc; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_RENDER_TARGET + | D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + *ppInterface = ref(new D3D11Texture2D( + m_device, pResource, desc)); + return S_OK; + } + + + HRESULT D3D11PresentDevice::FlushRenderingCommands() { + Com deviceContext = nullptr; + m_device->GetImmediateContext(&deviceContext); + + deviceContext->Flush(); + return S_OK; + } + + + HRESULT D3D11PresentDevice::GetDevice(REFGUID riid, void** ppvDevice) { + return m_device->QueryInterface(riid, ppvDevice); + } + +} diff --git a/src/d3d11/d3d11_present.h b/src/d3d11/d3d11_present.h new file mode 100644 index 000000000..70c9ad36f --- /dev/null +++ b/src/d3d11/d3d11_present.h @@ -0,0 +1,46 @@ +#pragma once + +#include + +#include "d3d11_include.h" + +#include "../dxgi/dxgi_interfaces.h" +#include "../dxgi/dxgi_resource.h" + +namespace dxvk { + + class D3D11Device; + + class D3D11PresentDevice : public ComObject { + + public: + + D3D11PresentDevice(); + ~D3D11PresentDevice(); + + HRESULT QueryInterface( + REFIID riid, + void** ppvObject) final; + + HRESULT WrapSwapChainBackBuffer( + IDXGIImageResourcePrivate* pResource, + const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, + IUnknown** ppInterface) final; + + HRESULT FlushRenderingCommands() final; + + HRESULT GetDevice( + REFGUID riid, + void** ppvDevice) final; + + void SetDeviceLayer(D3D11Device* pDevice) { + m_device = pDevice; + } + + private: + + D3D11Device* m_device = nullptr; + + }; + +} diff --git a/src/d3d11/d3d11_texture.cpp b/src/d3d11/d3d11_texture.cpp index a588e255a..2ff51837f 100644 --- a/src/d3d11/d3d11_texture.cpp +++ b/src/d3d11/d3d11_texture.cpp @@ -21,6 +21,7 @@ namespace dxvk { HRESULT D3D11Texture2D::QueryInterface(REFIID riid, void** ppvObject) { COM_QUERY_IFACE(riid, ppvObject, IUnknown); + COM_QUERY_IFACE(riid, ppvObject, ID3D11DeviceChild); COM_QUERY_IFACE(riid, ppvObject, ID3D11Resource); COM_QUERY_IFACE(riid, ppvObject, ID3D11Texture2D); diff --git a/src/d3d11/meson.build b/src/d3d11/meson.build index 085679ce1..1b8a9c970 100644 --- a/src/d3d11/meson.build +++ b/src/d3d11/meson.build @@ -3,6 +3,7 @@ d3d11_src = [ 'd3d11_context.cpp', 'd3d11_device.cpp', 'd3d11_main.cpp', + 'd3d11_present.cpp', 'd3d11_texture.cpp', 'd3d11_view.cpp', ] diff --git a/src/dxgi/dxgi_interfaces.h b/src/dxgi/dxgi_interfaces.h index ba3645bec..136d7a5bd 100644 --- a/src/dxgi/dxgi_interfaces.h +++ b/src/dxgi/dxgi_interfaces.h @@ -73,7 +73,58 @@ IDXGIImageResourcePrivate : public IDXGIResource { }; +/** + * \brief Private presentation device interface + * + * Allows a swap chain to communicate with the device + * in order to flush pending commands or create the + * back buffer interface. + */ +MIDL_INTERFACE("79352328-16f2-4f81-9746-9c2e2ccd43cf") +IDXGIPresentDevicePrivate : public IUnknown { + static const GUID guid; + + /** + * \brief Wraps swap chain image into a texture interface + * + * Creates an interface to the back buffer image of a + * swap chain. This interface will be returned by the + * swap chain's \c GetBuffer method. + * \param [in] image Image to wrap + * \param [in] pSwapChainDesc Swap chain properties + * \param [in] ppInterface Target interface + * \returns \c S_OK on success + */ + virtual HRESULT WrapSwapChainBackBuffer( + IDXGIImageResourcePrivate* pResource, + const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, + IUnknown** ppInterface) = 0; + + /** + * \brief Flushes the immediate context + * + * Used by the swap chain's \c Present method to + * ensure that all rendering commands get dispatched + * before presenting the swap chain's back buffer. + * \returns \c S_OK on success + */ + virtual HRESULT FlushRenderingCommands() = 0; + + /** + * \brief Underlying DXVK device + * + * \param [in] riid Device type + * \param [in] ppDevice device + * \returns DXVK device handle + */ + virtual HRESULT GetDevice( + REFGUID riid, + void** ppDevice) = 0; +}; + + DXVK_DEFINE_GUID(IDXGIAdapterPrivate); DXVK_DEFINE_GUID(IDXGIDevicePrivate); +DXVK_DEFINE_GUID(IDXGIPresentDevicePrivate); DXVK_DEFINE_GUID(IDXGIBufferResourcePrivate); DXVK_DEFINE_GUID(IDXGIImageResourcePrivate); diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index 06a0869af..daf83cf47 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -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(IDXGIDevicePrivate), + if (FAILED(pDevice->QueryInterface(__uuidof(IDXGIPresentDevicePrivate), reinterpret_cast(&m_device)))) throw DxvkError("DxgiSwapChain::DxgiSwapChain: Invalid device"); @@ -52,7 +52,11 @@ namespace dxvk { throw DxvkError("DxgiSwapChain::DxgiSwapChain: Failed to set initial fullscreen state"); // TODO clean up here - Rc dxvkDevice = m_device->GetDXVKDevice(); + Com dxgiDevice; + m_device->GetDevice(__uuidof(IDXGIDevicePrivate), + reinterpret_cast(&dxgiDevice)); + + Rc dxvkDevice = dxgiDevice->GetDXVKDevice(); Rc dxvkAdapter = dxvkDevice->adapter(); m_context = dxvkDevice->createContext(); @@ -189,24 +193,20 @@ namespace dxvk { HRESULT DxgiSwapChain::Present(UINT SyncInterval, UINT Flags) { std::lock_guard lock(m_mutex); - // TODO implement generic swap chain client interface - Com d3d11device; + // Query DXGI device to retrieve DXVK device + Com dxgiDevice; - if (FAILED(m_device->QueryInterface(__uuidof(ID3D11DevicePrivate), - reinterpret_cast(&d3d11device)))) { - Logger::err("DxgiSwapChain::Present: Invalid swap chain client interface"); - return E_INVALIDARG; - } + m_device->GetDevice(__uuidof(IDXGIDevicePrivate), + reinterpret_cast(&dxgiDevice)); try { // Submit pending rendering commands // before recording the present code. - d3d11device->FlushRenderingCommands(); + m_device->FlushRenderingCommands(); // TODO implement sync interval // TODO implement flags - - auto dxvkDevice = d3d11device->GetDXVKDevice(); + auto dxvkDevice = dxgiDevice->GetDXVKDevice(); auto framebuffer = m_swapchain->getFramebuffer(m_acquireSync); auto framebufferSize = framebuffer->size(); @@ -359,14 +359,11 @@ namespace dxvk { void DxgiSwapChain::createBackBuffer() { // TODO select format based on DXGI format // TODO support proper multi-sampling - const Rc dxvkDevice = m_device->GetDXVKDevice(); + Com dxgiDevice; + m_device->GetDevice(__uuidof(IDXGIDevicePrivate), + reinterpret_cast(&dxgiDevice)); - // TODO implement generic swap chain client interface - Com d3d11device; - - if (FAILED(m_device->QueryInterface(__uuidof(ID3D11DevicePrivate), - reinterpret_cast(&d3d11device)))) - throw DxvkError("DxgiSwapChain::Present: Invalid swap chain client interface"); + const Rc dxvkDevice = dxgiDevice->GetDXVKDevice(); // Create an image that can be rendered to // and that can be used as a sampled texture. @@ -399,7 +396,7 @@ namespace dxvk { | VK_ACCESS_SHADER_READ_BIT; imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; - if (FAILED(DXGICreateImageResourcePrivate(m_device.ptr(), &imageInfo, + if (FAILED(DXGICreateImageResourcePrivate(dxgiDevice.ptr(), &imageInfo, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, DXGI_USAGE_BACK_BUFFER | m_desc.BufferUsage, &resource))) throw DxvkError("DxgiSwapChain::createBackBuffer: Failed to create back buffer"); @@ -421,7 +418,7 @@ namespace dxvk { // Wrap the back buffer image into an interface // that the device can use to access the image. - if (FAILED(d3d11device->WrapSwapChainBackBuffer(resource.ptr(), &m_desc, &m_backBufferIface))) + if (FAILED(m_device->WrapSwapChainBackBuffer(resource.ptr(), &m_desc, &m_backBufferIface))) throw DxvkError("DxgiSwapChain::createBackBuffer: Failed to create back buffer interface"); } diff --git a/src/dxgi/dxgi_swapchain.h b/src/dxgi/dxgi_swapchain.h index 4915e8f64..c92298dd4 100644 --- a/src/dxgi/dxgi_swapchain.h +++ b/src/dxgi/dxgi_swapchain.h @@ -80,9 +80,9 @@ namespace dxvk { std::mutex m_mutex; - Com m_factory; - Com m_adapter; - Com m_device; + Com m_factory; + Com m_adapter; + Com m_device; DXGI_SWAP_CHAIN_DESC m_desc; DXGI_FRAME_STATISTICS m_stats; diff --git a/src/util/com/com_guid.cpp b/src/util/com/com_guid.cpp index 10a980aef..d2145f9e8 100644 --- a/src/util/com/com_guid.cpp +++ b/src/util/com/com_guid.cpp @@ -6,11 +6,10 @@ 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 IDXGIPresentDevicePrivate::guid = {0x79352328,0x16f2,0x4f81,{0x97,0x46,0x9c,0x2e,0x2c,0xcd,0x43,0xcf}}; const GUID IDXGIBufferResourcePrivate::guid = {0x5679becd,0x8547,0x4d93,{0x96,0xa1,0xe6,0x1a,0x1c,0xe7,0xef,0x37}}; const GUID IDXGIImageResourcePrivate::guid = {0x1cfe6592,0x7de0,0x4a07,{0x8d,0xcb,0x45,0x43,0xcb,0xbc,0x6a,0x7d}}; -const GUID ID3D11DevicePrivate::guid = {0xab2a2a58,0xd2ac,0x4ca0,{0x9a,0xd9,0xa2,0x60,0xca,0xfa,0x00,0xc8}}; - std::ostream& operator << (std::ostream& os, REFIID guid) { os.width(8); os << std::hex << guid.Data1 << '-';