Add WrapSharedHandle to D3D12 backend

WrapSharedHandle uses a HANDLE and an acquire key to create
a Dawn texture object.

A future change will use the acquire key to manage a keyed shared
mutex with Chromium code.

Bug: dawn:27
Change-Id: I1c0ef8d022158abf3f1c6731a37ee3f51632fcf9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10540
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Rafael Cintron
2019-09-02 19:19:34 +00:00
committed by Commit Bot service account
parent 824424fa35
commit 179d7b28a3
8 changed files with 355 additions and 1 deletions

View File

@@ -19,12 +19,20 @@
#include <dawn_native/DawnNative.h>
#include <windows.h>
#include <wrl/client.h>
struct ID3D12Device;
namespace dawn_native { namespace d3d12 {
DAWN_NATIVE_EXPORT Microsoft::WRL::ComPtr<ID3D12Device> GetD3D12Device(DawnDevice device);
DAWN_NATIVE_EXPORT DawnSwapChainImplementation CreateNativeSwapChainImpl(DawnDevice device,
HWND window);
DAWN_NATIVE_EXPORT DawnTextureFormat
GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain);
DAWN_NATIVE_EXPORT DawnTexture WrapSharedHandle(DawnDevice device,
const DawnTextureDescriptor* descriptor,
HANDLE sharedHandle);
}} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12BACKEND_H_