1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-22 23:52:10 +01:00
dxvk/src/d3d9/d3d9_interop.cpp

50 lines
1.3 KiB
C++
Raw Normal View History

#include "d3d9_interop.h"
#include "d3d9_interface.h"
namespace dxvk {
////////////////////////////////
// Interface Interop
///////////////////////////////
D3D9VkInteropInterface::D3D9VkInteropInterface(
D3D9InterfaceEx* pInterface)
: m_interface(pInterface) {
}
D3D9VkInteropInterface::~D3D9VkInteropInterface() {
}
ULONG STDMETHODCALLTYPE D3D9VkInteropInterface::AddRef() {
return m_interface->AddRef();
}
ULONG STDMETHODCALLTYPE D3D9VkInteropInterface::Release() {
return m_interface->Release();
}
HRESULT STDMETHODCALLTYPE D3D9VkInteropInterface::QueryInterface(
REFIID riid,
void** ppvObject) {
return m_interface->QueryInterface(riid, ppvObject);
}
void STDMETHODCALLTYPE D3D9VkInteropInterface::GetInstanceHandle(
VkInstance* pInstance) {
if (pInstance != nullptr)
*pInstance = m_interface->GetInstance()->handle();
}
void STDMETHODCALLTYPE D3D9VkInteropInterface::GetPhysicalDeviceHandle(
UINT Adapter,
VkPhysicalDevice* pPhysicalDevice) {
if (pPhysicalDevice != nullptr) {
D3D9Adapter* adapter = m_interface->GetAdapter(Adapter);
*pPhysicalDevice = adapter ? adapter->GetDXVKAdapter()->handle() : nullptr;
}
}
}