diff --git a/include/dawn/native/D3D11Backend.h b/include/dawn/native/D3D11Backend.h index c2a03d946a..b090071799 100644 --- a/include/dawn/native/D3D11Backend.h +++ b/include/dawn/native/D3D11Backend.h @@ -15,7 +15,7 @@ #ifndef INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_ #define INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_ -#include +#include #include #include @@ -30,6 +30,8 @@ struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public d3d::AdapterDiscovery explicit AdapterDiscoveryOptions(Microsoft::WRL::ComPtr adapter); }; +DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr GetD3D11Device(WGPUDevice device); + } // namespace dawn::native::d3d11 #endif // INCLUDE_DAWN_NATIVE_D3D11BACKEND_H_ diff --git a/src/dawn/native/d3d11/D3D11Backend.cpp b/src/dawn/native/d3d11/D3D11Backend.cpp index e166e6a2f2..f4d4c0811e 100644 --- a/src/dawn/native/d3d11/D3D11Backend.cpp +++ b/src/dawn/native/d3d11/D3D11Backend.cpp @@ -20,6 +20,8 @@ #include #include "dawn/native/d3d/d3d_platform.h" +#include "dawn/native/d3d11/DeviceD3D11.h" +#include "dawn/native/d3d11/Forward.h" namespace dawn::native::d3d11 { @@ -28,4 +30,8 @@ AdapterDiscoveryOptions::AdapterDiscoveryOptions() : AdapterDiscoveryOptions(nul AdapterDiscoveryOptions::AdapterDiscoveryOptions(ComPtr adapter) : d3d::AdapterDiscoveryOptions(WGPUBackendType_D3D11, std::move(adapter)) {} +Microsoft::WRL::ComPtr GetD3D11Device(WGPUDevice device) { + return ToBackend(FromAPI(device))->GetD3D11Device(); +} + } // namespace dawn::native::d3d11