Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::BufferMappingHost Class Referenceabstract

The facts a backend supplies about its own buffers so BufferMappingTable can decide when a mapping is readable and which bytes it names. More...

#include "donner/gpu/BufferMappingTable.h"

Public Member Functions

virtual ~BufferMappingHost ()=default
 Virtual destructor; the table never owns a host.
virtual std::span< const uint8_t > mappableBytes (uint32_t bufferSlotIndex) const =0
 Host-visible bytes of a live buffer slot, or an empty span when the slot holds no live mappable allocation.
virtual uint64_t completedSubmissionSerial () const =0
 Highest submission serial the device has completed. A backend publishes a submission's failure, through deviceLost, before the serial that completes it.
virtual MapWaitKind waitForSubmission (uint64_t serial, double sliceSeconds)=0
 Waits at most sliceSeconds for serial to complete, and reports how it spent the slice.
virtual bool deviceLost () const =0
 Whether the device has taken a terminal failure, after which no submission can ever complete.

Detailed Description

The facts a backend supplies about its own buffers so BufferMappingTable can decide when a mapping is readable and which bytes it names.

Only these four answers are backend-specific. When a range is ready, what a stale or invalidated handle does, and which error a caller sees are decisions the table makes for every backend, so two backends cannot drift into two different mapping contracts.

Member Function Documentation

◆ mappableBytes()

virtual std::span< const uint8_t > donner::gpu::BufferMappingHost::mappableBytes ( uint32_t bufferSlotIndex) const
pure virtual

Host-visible bytes of a live buffer slot, or an empty span when the slot holds no live mappable allocation.

The span aliases the backend's allocation and stays valid only while that allocation does, so the table re-asks rather than caching it.

Parameters
bufferSlotIndexSlot of the buffer.

◆ waitForSubmission()

virtual MapWaitKind donner::gpu::BufferMappingHost::waitForSubmission ( uint64_t serial,
double sliceSeconds )
pure virtual

Waits at most sliceSeconds for serial to complete, and reports how it spent the slice.

Whether the submission completed is not reported here: the table re-reads readiness afterwards anyway, because a wait hands control to the backend and the mapped buffer can be retired while the slice is blocked. What only this call can say is whether it blocked on a completion signal or rechecked readiness itself, which is the difference the readback statistics carry.

Parameters
serialSubmission serial to wait for.
sliceSecondsLongest this call may block; zero polls without calling the host wait.

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