From 4930beefd77954687c7268a19c6487db107b5edc Mon Sep 17 00:00:00 2001 From: Frank Yellin Date: Mon, 21 Oct 2024 14:20:49 -0700 Subject: [PATCH] Only keep track of sub-objects when necessary. --- tests_mem/test_object_retention.py | 8 ++++---- wgpu/backends/wgpu_native/_api.py | 3 +-- wgpu/resources/codegen_report.md | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests_mem/test_object_retention.py b/tests_mem/test_object_retention.py index 609fe7ba..198d493a 100644 --- a/tests_mem/test_object_retention.py +++ b/tests_mem/test_object_retention.py @@ -24,12 +24,12 @@ fn vertex_main( @location(0) position: vec2f ) -> @builtin(position) vec4f { return vec4f(position + offset, 0, 1.0); } - + @fragment - fn fragment_main() -> @location(0) vec4f { - return vec4f(); + fn fragment_main() -> @location(0) vec4f { + return vec4f(); } - + @compute @workgroup_size(1) fn main(@builtin(global_invocation_id) index: vec3) { diff --git a/wgpu/backends/wgpu_native/_api.py b/wgpu/backends/wgpu_native/_api.py index 18ebf79a..7f48996d 100644 --- a/wgpu/backends/wgpu_native/_api.py +++ b/wgpu/backends/wgpu_native/_api.py @@ -3329,8 +3329,7 @@ def finish(self, *, label: str = ""): id = libf.wgpuRenderBundleEncoderFinish(self._internal, struct) # The other encoders require that we call self._release() when # we're done with it. But that doesn't seem to be an issue here. - # There doesn't seem to be an issue with needing to keep the objects alive after - # the call to finish(). + # We no longer need to keep these objects alive after the call to finish(). self._objects_to_keep_alive.clear() return GPURenderBundle(label, id, self._device) diff --git a/wgpu/resources/codegen_report.md b/wgpu/resources/codegen_report.md index 6ed003ec..7b53c1cf 100644 --- a/wgpu/resources/codegen_report.md +++ b/wgpu/resources/codegen_report.md @@ -18,7 +18,7 @@ * Diffs for GPUTextureView: add size, add texture * Diffs for GPUBindingCommandsMixin: change set_bind_group * Diffs for GPUQueue: add read_buffer, add read_texture, hide copy_external_image_to_texture -* Validated 37 classes, 120 methods, 46 properties +* Validated 37 classes, 121 methods, 46 properties ### Patching API for backends/wgpu_native/_api.py * Validated 37 classes, 120 methods, 0 properties ## Validating backends/wgpu_native/_api.py