Expand description
Presentation settings and HDR output (see sg_abi::display and sg_abi::hdr).
Present mode and frame latency can also be set the usual wgpu way, in
SurfaceConfiguration; set_present changes them later without the game
reconfiguring (the host re-applies the game’s configuration). The user’s
launch settings always take precedence (status::LOCKED).
Modules§
- fullscreen_
mode - Fullscreen codes.
- mode
- Present-mode codes (the
reprofwgpu::PresentMode). - status
- Return codes of the display functions.
Structs§
- HdrMetadata
- Static HDR metadata (SMPTE ST 2086 mastering display + CTA-861.3 content
light levels), as 12 little-endian
f32s in this order. - Output
- The negotiated output: what to put in
SurfaceConfigurationand the shader uniform.
Enums§
Constants§
- HDR_
WGSL - WGSL for guests: paste (or
concat!) into a shader module and bind anSgOutputuniform built byOutput::uniform.
Functions§
- info
- Present modes, the active mode and latency, frame cap, refresh rate, fullscreen state, HDR formats and which settings the user locked.
- negotiate
- Picks the output for a surface offering
formats(format, color spaces), in order of preference: PQ on a 10-bit format, scRGB, PQ on fp16, then SDR (an*Srgbformat first).allow_hdr = falseforces SDR. ReturnsNoneonly if no format is usable at all. - negotiate_
output - Picks format, color space and encoding for
caps(HDR if offered andallow_hdr). - set_
frame_ cap - Frames per second; 0 removes the cap.
- set_
frame_ latency - set_
fullscreen - Needs a recent user gesture (key or click) and is rate limited.
- set_
hdr_ metadata - set_
present latency1..=3, or 0 to keep it.- stats
- Rolling timing statistics (present interval, acquire/present blocking, display latency where the platform reports present times).