A fixed observer avoids allocating in the measured Device::submit path.
More...
#include "donner/svg/renderer/geode/benchmarks/DrawCpuWorkload.h"
|
| void | onBufferCreated () override |
| | A buffer allocation was created.
|
| void | onTextureCreated () override |
| | A texture allocation the device owns was created. A registration of a texture the device does not own is not an allocation and is not reported.
|
| void | onTextureReleased () override |
| | The device's ownership of a texture allocation it made ended: its backing was released through Device::destroyTextureBacking, or the texture was destroyed and the last submission using it completed and its slot was recycled.
|
| void | onBindGroupCreated () override |
| | A bind group was created.
|
| void | onBufferWritten (uint64_t) override |
| | A queue write to a buffer was accepted.
|
| void | onTextureWritten (uint64_t) override |
| | A queue write to a texture was accepted.
|
| void | onSubmitted (uint64_t commandBufferCount, uint64_t drawCount) override |
| | Work reached the backend's queue as one submission.
|
|
virtual | ~DeviceObserver ()=default |
| | Destructor.
|
|
|
uint64_t | submissions = 0 |
| | Observed single-command-buffer submissions.
|
|
uint64_t | lastDraws = 0 |
| | Draw count in the last such submission.
|
|
|
| DeviceObserver ()=default |
| | Constructible only as a base.
|
|
| DeviceObserver (const DeviceObserver &)=default |
| | Copyable only by a derived observer, so an observer is never sliced through its base.
|
| DeviceObserver & | operator= (const DeviceObserver &)=default |
| | Assignable only by a derived observer.
|
A fixed observer avoids allocating in the measured Device::submit path.
◆ onBindGroupCreated()
| void donner::geode::benchmarks::DrawCountObserver::onBindGroupCreated |
( |
| ) |
|
|
inlineoverridevirtual |
◆ onBufferCreated()
| void donner::geode::benchmarks::DrawCountObserver::onBufferCreated |
( |
| ) |
|
|
inlineoverridevirtual |
◆ onBufferWritten()
| void donner::geode::benchmarks::DrawCountObserver::onBufferWritten |
( |
uint64_t | byteCount | ) |
|
|
inlineoverridevirtual |
◆ onSubmitted()
| void donner::geode::benchmarks::DrawCountObserver::onSubmitted |
( |
uint64_t | commandBufferCount, |
|
|
uint64_t | drawCount ) |
|
inlineoverridevirtual |
Work reached the backend's queue as one submission.
- Parameters
-
| commandBufferCount | Command buffers the submission carried. Zero for a submission a backend made on its own, outside Device::submit, to make the queue progress. |
| drawCount | Draws counted under one rule on every backend: each draw command, including one with no vertices or no instances, and each indexed draw command that is not empty (see IsEmptyIndexedDraw), whether or not the backend issues it natively. |
Implements donner::gpu::DeviceObserver.
◆ onTextureCreated()
| void donner::geode::benchmarks::DrawCountObserver::onTextureCreated |
( |
| ) |
|
|
inlineoverridevirtual |
A texture allocation the device owns was created. A registration of a texture the device does not own is not an allocation and is not reported.
Implements donner::gpu::DeviceObserver.
◆ onTextureReleased()
| void donner::geode::benchmarks::DrawCountObserver::onTextureReleased |
( |
| ) |
|
|
inlineoverridevirtual |
The device's ownership of a texture allocation it made ended: its backing was released through Device::destroyTextureBacking, or the texture was destroyed and the last submission using it completed and its slot was recycled.
Reported at most once per owned allocation, on the thread using the device, to the observer installed at that moment. That includes an allocation made before this observer was installed, whose creation it never heard, so an observer installed late can count more releases than creations. An allocation still owned when the device is destroyed, and one whose retired slot is never recycled, are not reported. Releasing a registration of a texture the device does not own ends no ownership and is not reported.
The allocation itself may outlive the report: an export of the texture keeps it alive until its last holder lets go, and Device::sharedTextureTailBytes counts those bytes meanwhile. Nothing is reported when that holder finally releases it. A destroyed texture a holder still reads enters that gauge when it is retired but is reported here only when its slot is recycled, so while its last submission is in flight both count it.
Implements donner::gpu::DeviceObserver.
◆ onTextureWritten()
| void donner::geode::benchmarks::DrawCountObserver::onTextureWritten |
( |
uint64_t | byteCount | ) |
|
|
inlineoverridevirtual |
A queue write to a texture was accepted.
- Parameters
-
| byteCount | Bytes the backend handed its queue for the write: the caller's span, or the repacked rows on a backend that repacks them first, so this can differ between backends. |
Implements donner::gpu::DeviceObserver.
The documentation for this class was generated from the following file: