mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-15 09:35:57 +00:00
This patch implements the asynchronous path of CreateComputePipelineAsync on D3D12 backend with the basic framework of the dawn_unittest AsyncTaskTest.Basic. 1. Call the constructor of dawn_native::d3d12::ComputePipeline in the main thread. 2. Execute dawn_native::ComputePipelineBase::Initialize() (a virtual function) asynchronously. 3. Ensure every operation in dawn_native::d3d12::ComputePipeline::Initialize() is thread-safe (PersistentCache). 4. Save all the return values (pipeline object or error message, userdata, etc) in a CreateComputePipelineAsyncWaitableCallbackTask object and insert this callback task into CallbackTaskManager. 5. In Callback.Finish(): - Insert the pipeline object into the pipeline cache if necessary - Call WGPUCreateComputePipelineAsyncCallback Note that as we always handle the front-end pipeline cache in the main thread, we don't need to make it thread-safe right now. BUG=dawn:529 TEST=dawn_end2end_tests Change-Id: I7eba2ce550b32439a94b2a4d1aa7f1b3383aa514 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47900 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>