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

Method extent

native/shared/src/renderer/transient.rs:49–57  ·  view source on GitHub ↗

Resolve to concrete (width, height) in physical pixels.

(self, swap_w: u32, swap_h: u32)

Source from the content-addressed store, hash-verified

47impl SizePolicy {
48 /// Resolve to concrete (width, height) in physical pixels.
49 pub fn extent(self, swap_w: u32, swap_h: u32) -> (u32, u32) {
50 let max1 = |n: u32| n.max(1);
51 match self {
52 SizePolicy::Swapchain => (max1(swap_w), max1(swap_h)),
53 SizePolicy::HalfSwapchain => (max1(swap_w / 2), max1(swap_h / 2)),
54 SizePolicy::QuarterSwapchain => (max1(swap_w / 4), max1(swap_h / 4)),
55 SizePolicy::Fixed(w, h) => (max1(w), max1(h)),
56 }
57 }
58}
59
60/// Describes a transient texture the pool should own. Equality on

Callers 1

acquireMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected