pub struct LifeGuard { /* private fields */ }
Expand description
Information needed to decide when it’s safe to free some wgpu-core resource.
Each type representing a wgpu-core
resource, like Device
,
Buffer
, etc., contains a LifeGuard
which indicates whether
it is safe to free.
A resource may need to be retained for any of several reasons:
-
The user may hold a reference to it (via a
wgpu::Buffer
, say). -
Other resources may depend on it (a texture view’s backing texture, for example).
-
It may be used by commands sent to the GPU that have not yet finished execution.