Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
Device.h File Reference

donner::gpu::Device - the abstract GPU device with shared fail-closed validation. More...

#include <chrono>
#include <cstdint>
#include <format>
#include <functional>
#include <memory>
#include <optional>
#include <span>
#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>
#include "donner/base/SmallVector.h"
#include "donner/base/Utils.h"
#include "donner/gpu/Commands.h"
#include "donner/gpu/Descriptors.h"
#include "donner/gpu/DeviceLost.h"
#include "donner/gpu/DeviceObserver.h"
#include "donner/gpu/GpuLimits.h"
#include "donner/gpu/GpuResult.h"
#include "donner/gpu/Handles.h"
#include "donner/gpu/TextureExport.h"
Include dependency graph for Device.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::gpu::SubmittedCommandBuffer
 One command buffer of a submission, as a backend receives it: the slot the buffer occupied before it was consumed, plus its validated commands in recording order. More...
struct  donner::gpu::SurfaceTexture
 A texture acquired from a surface for one frame, with the state the surface reported while handing it over. More...
class  donner::gpu::Device
 Abstract GPU device: resource creation, queue writes, and submission with shared fail-closed validation. More...
struct  donner::gpu::Device::MapWaitTestHooks
 Test seam for donner::gpu::Device::waitForMapping. Production callers pass none; a test injects a clock and a rest so a budget is verified deterministically and without spending it. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

Result< uint64_t > donner::gpu::ValidateTexelCopyInternal (const TexelCopyBufferLayout &layout, const Extent2d &copySize, TextureFormat format, std::string_view context)
 Internal: validates a texel copy layout against a copy extent and format, and returns the exclusive end byte offset the copy requires in the buffer or host memory it describes.

Detailed Description

donner::gpu::Device - the abstract GPU device with shared fail-closed validation.


Class Documentation

◆ donner::gpu::Device::MapWaitTestHooks

struct donner::gpu::Device::MapWaitTestHooks

Test seam for donner::gpu::Device::waitForMapping. Production callers pass none; a test injects a clock and a rest so a budget is verified deterministically and without spending it.

Class Members
function< time_point()> now Clock the budget is measured against. Defaults to std::chrono::steady_clock::now.
function< void(microseconds)> rest Rests for the given duration. Defaults to std::this_thread::sleep_for.

Function Documentation

◆ ValidateTexelCopyInternal()

Result< uint64_t > donner::gpu::ValidateTexelCopyInternal ( const TexelCopyBufferLayout & layout,
const Extent2d & copySize,
TextureFormat format,
std::string_view context )

Internal: validates a texel copy layout against a copy extent and format, and returns the exclusive end byte offset the copy requires in the buffer or host memory it describes.

Shared by Device::writeTexture and CommandEncoder::copyTextureToBuffer; not part of the public API.

Parameters
layoutRow layout to validate (256-aligned bytesPerRow covering one row, and rowsPerImage covering the copy height).
copySizeCopy extent in texels.
formatTexel format of the texture side of the copy.
contextOperation name for diagnostics.