mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 07:21:04 +01:00
[deno] Fix dropping of command encoders/buffers, and an enum typo (#7808)
Fixes #7797
This commit is contained in:
1 parent
371c8fd1db
commit
afa0f71736
6 files changed
+35
-24
No files matched your search
@@ -1,7 +1,5 @@
|
||||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
|
||||
use std::cell::OnceCell;
|
||||
|
||||
use deno_core::op2;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
@@ -12,15 +10,11 @@ pub struct GPUCommandBuffer {
|
||||
pub instance: Instance,
|
||||
pub id: wgpu_core::id::CommandBufferId,
|
||||
pub label: String,
|
||||
|
||||
pub consumed: OnceCell<()>,
|
||||
}
|
||||
|
||||
impl Drop for GPUCommandBuffer {
|
||||
fn drop(&mut self) {
|
||||
if self.consumed.get().is_none() {
|
||||
self.instance.command_buffer_drop(self.id);
|
||||
}
|
||||
self.instance.command_buffer_drop(self.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user