Bug 1905383: Make WebGPU encoders not cycle check their subresources. r=webgpu-reviewers,teoxoy

The encoder classes already have strong references to the resources they
rely upon. That is enough to prevent those resources from being
released before the encoder. That's all we need! Including the resources
in cycle checking is just making it possible for the resource and the
encoder to be unlinked in the same cycle, in arbitrary order. That's
dangerous because it's the same outcome as if the encoder didn't have a
strong reference to the resource at all.

Differential Revision: https://phabricator.services.mozilla.com/D225914
This commit is contained in:
Brad Werth
2024-10-17 13:43:49 +00:00
parent ac701f1d74
commit 9fd4c45a90
3 changed files with 3 additions and 7 deletions

View File

@@ -13,8 +13,7 @@
namespace mozilla::webgpu {
GPU_IMPL_CYCLE_COLLECTION(ComputePassEncoder, mParent, mUsedBindGroups,
mUsedPipelines)
GPU_IMPL_CYCLE_COLLECTION(ComputePassEncoder, mParent)
GPU_IMPL_JS_WRAP(ComputePassEncoder)
void ffiWGPUComputePassDeleter::operator()(ffi::WGPURecordedComputePass* raw) {

View File

@@ -16,8 +16,7 @@
namespace mozilla::webgpu {
GPU_IMPL_CYCLE_COLLECTION(RenderBundleEncoder, mParent, mUsedBindGroups,
mUsedBuffers, mUsedPipelines, mUsedTextureViews)
GPU_IMPL_CYCLE_COLLECTION(RenderBundleEncoder, mParent)
GPU_IMPL_JS_WRAP(RenderBundleEncoder)
void ffiWGPURenderBundleEncoderDeleter::operator()(

View File

@@ -13,9 +13,7 @@
namespace mozilla::webgpu {
GPU_IMPL_CYCLE_COLLECTION(RenderPassEncoder, mParent, mUsedBindGroups,
mUsedBuffers, mUsedPipelines, mUsedTextureViews,
mUsedRenderBundles)
GPU_IMPL_CYCLE_COLLECTION(RenderPassEncoder, mParent)
GPU_IMPL_JS_WRAP(RenderPassEncoder)
void ffiWGPURenderPassDeleter::operator()(ffi::WGPURecordedRenderPass* raw) {