diff --git a/src/d3d9/d3d9_interfaces.h b/src/d3d9/d3d9_interfaces.h index 0d1b363250a..665775523f1 100644 --- a/src/d3d9/d3d9_interfaces.h +++ b/src/d3d9/d3d9_interfaces.h @@ -3,6 +3,26 @@ #include "d3d9_include.h" #include "../vulkan/vulkan_loader.h" +using D3D9VkExtQueueLockCallback = void(bool); + +/** + * \brief Device import info + */ +struct D3D9VkExtDeviceImportInfo { + VkDevice device; + VkQueue graphicsQueue; + uint32_t graphicsQueueFamily; + VkQueue transferQueue; + uint32_t transferQueueFamily; + VkQueue sparseQueue; + uint32_t sparseQueueFamily; + uint32_t extensionCount; + const char** extensionNames; + const VkPhysicalDeviceFeatures2* features; + D3D9VkExtQueueLockCallback* queueLockCallback; +}; + + /** * \brief D3D9 interface for Vulkan interop * @@ -28,6 +48,39 @@ ID3D9VkInteropInterface : public IUnknown { virtual void STDMETHODCALLTYPE GetPhysicalDeviceHandle( UINT Adapter, VkPhysicalDevice* pPhysicalDevice) = 0; + + /** + * \brief Gets the VkDeviceCreateInfo for a D3D9 adapter + * + * \param [in] Adapter Adapter ordinal + * \param [in] ... Arguments to IDirect3D9Ex::CreateDeviceEx + * \param [out] ppCreateInfo The Vulkan device create info + */ + virtual HRESULT GetDeviceCreateInfo( + UINT Adapter, + D3DDEVTYPE DeviceType, + HWND hFocusWindow, + DWORD BehaviorFlags, + D3DPRESENT_PARAMETERS* pPresentationParameters, + D3DDISPLAYMODEEX* pFullscreenDisplayMode, + VkDeviceCreateInfo** ppCreateInfo) = 0; + + /** + * \brief Create a D3D9 device for an existing Vulkan device + * + * It is suggested to create the device with the + * VkDeviceCreateInfo returned by GetDeviceCreateInfo, + * which will specify everything the device needs for + * DXVK to function. + * + * \param [in] Adapter Adapter ordinal + * \param [in] pInfo Info about the created device + * \param [out] ppReturnedDevice The D3D9 device + */ + virtual HRESULT ImportDevice( + UINT Adapter, + D3D9VkExtDeviceImportInfo* pInfo, + IDirect3DDevice9Ex** ppReturnedDevice) = 0; }; /**