pub enum HdrOutputMode {
Sdr,
Hdr {
max_edr: f32,
encoding: HdrEncoding,
},
}Expand description
Resolved swapchain colour-output mode. Threaded into Metal + DirectX at
init (both honour Hdr end-to-end, including the PQ-encoded branch);
Vulkan honours the ExtendedLinear Hdr arm but ignores the PQ
encoding flag and falls back to SDR on a panel that reports no EDR
headroom.
Variants§
Sdr
Tone-map + gamma-encode the HDR scene into the standard BGRA8Unorm swapchain. FXAA + ColorLut run.
Hdr
Drive an EDR-capable swapchain (RGBA16Float, Display P3 family
colour space, wantsExtendedDynamicRangeContent = true). The
composite shader’s hdr_output branch skips the tonemap, gamma
encode, FXAA, and LUT. encoding picks between scRGB-linear
passthrough and PQ-encoded output. max_edr is the panel-reported
headroom (e.g. 2.0 on an HDR400 panel, 8.0+ on HDR1000), surfaced
via the StatHud EDR chip.
Fields
max_edr: f32Reported maximum extended-range colour-component multiplier; SDR reference white is 1.0, so values above that drive HDR.
encoding: HdrEncodingWhether the composite shader emits PQ-encoded values or linear extended-range values. Drives both the colour-space tag and the shader branch.
Implementations§
Source§impl HdrOutputMode
impl HdrOutputMode
Sourcepub fn resolve(
hdr_display_requested: bool,
pq_requested: bool,
max_edr: f32,
) -> Self
pub fn resolve( hdr_display_requested: bool, pq_requested: bool, max_edr: f32, ) -> Self
Build the mode from the world’s authored request and the platform’s
measured EDR multiplier. The asset toggle is the gate: even on a
capable display, no HDR unless hdr_display = true. The reverse
(hdr_display = true on an SDR panel) falls back to Self::Sdr
and is logged once by the backend. pq_requested is honoured only
when HDR resolves to on; off-by-default keeps the existing
extended-linear path as the safer fallback.
Sourcepub fn shader_flag(&self) -> f32
pub fn shader_flag(&self) -> f32
Value to push into PostProcessParams.hdr_output so the composite
shader’s > 0.5 branch lights up on the HDR path and stays inert
on the SDR path.
Sourcepub fn pq_flag(&self) -> f32
pub fn pq_flag(&self) -> f32
PQ branch value pushed into PostProcessParams.pq_output. The shader
reads it inside its hdr_output > 0.5 branch and switches between
linear-passthrough and PQ-encode. Always 0.0 on the SDR path.
Sourcepub fn is_hdr(&self) -> bool
pub fn is_hdr(&self) -> bool
True when the renderer is on the HDR path. Cheap predicate for log
messages + the runtime’s hdr_display=on/off summary line.
Sourcepub fn post_process_params(
&self,
tunables: PostProcessTunables,
) -> PostProcessParams
pub fn post_process_params( &self, tunables: PostProcessTunables, ) -> PostProcessParams
Compose the GPU-facing composite uniform from the authored tunables and
this negotiated mode. The backends call it once at init; afterwards a
live tunable push goes through PostProcessParams::set_tunables, which
leaves the two flags stamped here alone.
Trait Implementations§
Source§impl Clone for HdrOutputMode
impl Clone for HdrOutputMode
Source§fn clone(&self) -> HdrOutputMode
fn clone(&self) -> HdrOutputMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more