Add D3D12 keyed shared mutexes to Dawn

Dawn creates a keyed shared mutex for all wrapped resources and acquires
the mutex before the texture is used in an ExecuteCommandList call.

To coordinate with external clients, backend API has been extended
to allow clients to get and set the acquire key.

Pending and queue command lists have now been merged into one.

A future change will adjust GetPendingCommandContext to return a raw
command context without the need for error handling.

Bug:dawn:217
Change-Id: Ia96c449c305586407153f05ce75a40794b96027e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12220
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
This commit is contained in:
Rafael Cintron
2019-10-18 00:37:42 +00:00
committed by Commit Bot service account
parent 63f98f6e19
commit b2b2ef57a5
19 changed files with 531 additions and 141 deletions

View File

@@ -30,9 +30,11 @@ namespace dawn_native { namespace d3d12 {
DAWN_NATIVE_EXPORT DawnTextureFormat
GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain);
// Note: SharedHandle must be a handle to a texture object.
DAWN_NATIVE_EXPORT DawnTexture WrapSharedHandle(DawnDevice device,
const DawnTextureDescriptor* descriptor,
HANDLE sharedHandle);
HANDLE sharedHandle,
uint64_t acquireMutexKey);
}} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12BACKEND_H_