mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
D3D12: Support creating compute pipeline asynchronously
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>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
2adb3c83e4
commit
5e1ca53269
@@ -67,7 +67,7 @@ TEST_F(AsyncTaskTest, Basic) {
|
||||
dawn_platform::Platform platform;
|
||||
std::unique_ptr<dawn_platform::WorkerTaskPool> pool = platform.CreateWorkerTaskPool();
|
||||
|
||||
dawn_native::AsnycTaskManager taskManager(pool.get());
|
||||
dawn_native::AsyncTaskManager taskManager(pool.get());
|
||||
ConcurrentTaskResultQueue taskResultQueue;
|
||||
|
||||
constexpr size_t kTaskCount = 4u;
|
||||
|
||||
Reference in New Issue
Block a user