Skip to content

Commit

Permalink
Docs: specify that internal references exist as needed
Browse files Browse the repository at this point in the history
Issue: 29
  • Loading branch information
kainino0x committed Dec 21, 2024
1 parent f0121fc commit a68ea83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/articles/Ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Objects in `webgpu.h` are refcounted via the `AddRef` and `Release` functions.
The refcount only changes when these methods are called explicitly (not, for example, in \ref wgpuCommandEncoderFinish or \ref wgpuQueueSubmit).

Applications are *not* required to maintain refs to WebGPU objects which are internally used by other WebGPU objects (CommandBuffer→BindGroup, BindGroup→TextureView, TextureView→Texture, etc.); `webgpu.h` implementations must maintain internal references, as needed, to be internally memory safe. These *internal* references do *not* make it safe to use objects that have ever reached an *external* refcount of 0.

Memory for variable-sized outputs from the API (message strings, capability arrays, etc.) is managed in different ways depending on whether they are returned values or callback arguments.

## Returned with Ownership {#ReturnedWithOwnership}
Expand Down

0 comments on commit a68ea83

Please sign in to comment.