|
| | BufferMappingTable (BufferMappingHost &host) |
| Status | begin (uint32_t mappingSlotIndex, uint32_t bufferSlotIndex, uint64_t offsetBytes, uint64_t byteCount, uint64_t readySerial) |
| | Opens a mapping over byteCount bytes of bufferSlotIndex starting at offsetBytes.
|
| MapSliceReport | waitSlice (uint32_t mappingSlotIndex, double sliceSeconds) |
| | Waits up to sliceSeconds for one mapping, and reports what it found and how it waited.
|
| Result< std::span< const uint8_t > > | bytes (uint32_t mappingSlotIndex) const |
| | Bytes of a completed mapping, or a failure while it is pending, released, or invalidated.
|
| void | release (uint32_t mappingSlotIndex) |
| | Releases a mapping, so every remaining handle naming it reads as released.
|
| void | invalidateBuffer (uint32_t bufferSlotIndex) |
| | Invalidates every mapping of bufferSlotIndex, called when the buffer is retired so a mapping cannot outlive the allocation it points into.
|
|
size_t | liveMappingCountForTest () const |
| | How many mappings are currently open, counting ones whose buffer was retired: those are still open handles that have to be released. Test accessor for leak checks.
|
Tracks the host mappings a backend has open and answers the mapping hooks Device dispatches to it.
A mapping names a byte range of one buffer plus the submission that must complete before that range holds the bytes the caller asked for. Holding a mapping is not ownership of the buffer: destroying the buffer invalidates the mapping instead of keeping the allocation alive, so a read afterwards is a reported failure rather than a read of freed memory.
A mapping observes the work submitted before it was created. Writes still queued for a later submission are not part of it, because the submission that would carry them does not exist yet and waiting for it would be waiting for something the caller has not asked for.
| Result< std::span< const uint8_t > > donner::gpu::BufferMappingTable::bytes |
( |
uint32_t | mappingSlotIndex | ) |
const |
Bytes of a completed mapping, or a failure while it is pending, released, or invalidated.
The span aliases the backend's own allocation rather than a copy of it, so it is valid only until whichever of these comes first: the mapping is released, its buffer is retired, or the device is lost. Callers that outlive any of those copy the bytes out. The annotation states that contract to the compiler rather than enforcing it: the span is returned inside a Result, and the dangling diagnostic does not see through an unannotated class template.
- Parameters
-
| mappingSlotIndex | Slot of the mapping. |