Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::geode::GeodeWgpuAdapterDevice::MappingSlot::Completion Struct Reference

Public Member Functions

void unmapIfAbandoned ()
 Gives the buffer back once the mapping is gone and the map has succeeded.
void release ()
 Drops one reference, deleting the state with the last one.

Public Attributes

std::atomic< int > references {2}
 This record and the pending callback.
std::atomic< bool > done {false}
 Set once the callback has run.
std::atomic< bool > ok {false}
 Whether the map succeeded. Set once the mapping handle is gone, which makes whichever side observes the finished map responsible for giving the buffer back.
std::atomic< bool > abandoned {false}
std::atomic< bool > unmapClaimed {false}
 Claimed once by whichever side unmaps, so the two never both unmap and never both leave it to the other.
wgpu::Buffer buffer
 The buffer being mapped, holding a reference of its own: a map abandoned in flight completes after the mapping's slot is gone and must still have a buffer to unmap.

Member Function Documentation

◆ unmapIfAbandoned()

void donner::geode::GeodeWgpuAdapterDevice::MappingSlot::Completion::unmapIfAbandoned ( )
inline

Gives the buffer back once the mapping is gone and the map has succeeded.

Both the release and the completion call this, because either can be the one that sees both conditions hold. A buffer left mapped with nothing able to unmap it stays mapped for the rest of its life, and every later GPU use of it is invalid.


The documentation for this struct was generated from the following file: