MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / enable

Method enable

native/shared/src/drs.rs:63–69  ·  view source on GitHub ↗

Enable DRS targeting the given refresh rate in Hz. Snaps the internal index to whichever rung is closest to the renderer's current `render_scale` so the first step doesn't overshoot.

(&mut self, target_hz: f32, current_scale: f32)

Source from the content-addressed store, hash-verified

61 /// internal index to whichever rung is closest to the renderer's
62 /// current `render_scale` so the first step doesn't overshoot.
63 pub fn enable(&mut self, target_hz: f32, current_scale: f32) {
64 self.enabled = true;
65 self.target_frame_ms = 1000.0 / target_hz.max(1.0);
66 self.ema_ms = 0.0;
67 self.frames_since_step = 0;
68 self.idx = closest_step_idx(current_scale);
69 }
70
71 pub fn disable(&mut self) {
72 self.enabled = false;

Callers 13

bloom_enable_shadowsFunction · 0.45
bloom_enable_shadowsFunction · 0.45
bloom_enable_shadowsFunction · 0.45
set_shadows_enabledMethod · 0.45
bloom_enable_shadowsFunction · 0.45
bloom_enable_shadowsFunction · 0.45

Calls 1

closest_step_idxFunction · 0.85