mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Make Adapter and Instance lifetimes more robust
Previously, we would get a use-after-free if you dropped the instance before an adapter created from it. This CL fixes up the lifetimes such that Device refs Adapter refs Instance. Instance uses a cycle-breaking refcount so that it releases internal refs to its adapters when the last external ref is dropped. Bug: none Change-Id: I5304ec86f425247d4c45ca342fda393cc19689e3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99820 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
@@ -190,6 +190,9 @@ DAWN_NATIVE_EXPORT size_t GetLazyClearCountForTesting(WGPUDevice device);
|
||||
// Backdoor to get the number of deprecation warnings for testing
|
||||
DAWN_NATIVE_EXPORT size_t GetDeprecationWarningCountForTesting(WGPUDevice device);
|
||||
|
||||
// Backdoor to get the number of adapters an instance knows about for testing
|
||||
DAWN_NATIVE_EXPORT size_t GetAdapterCountForTesting(WGPUInstance instance);
|
||||
|
||||
// Query if texture has been initialized
|
||||
DAWN_NATIVE_EXPORT bool IsTextureSubresourceInitialized(
|
||||
WGPUTexture texture,
|
||||
|
||||
Reference in New Issue
Block a user