Skip to main content

test_device_limits

Function test_device_limits 

Source
pub fn test_device_limits(adapter: &Adapter, caps: &TierCaps) -> Limits
Expand description

The wgpu::Limits a test fixture’s own request_device call should ask for, given adapter and its already-probed caps — exactly the derivation [create_device] uses for the production device request (shared via [base_device_limits] plus effective_limits), so a fixture requesting these limits can never over-ask relative to what the production path would request for the very same adapter.

This is the fix for the iOS Simulator’s constrained Apple2 Metal profile (15 inter-stage shader variables, where wgpu::Limits::default() demands 16): a fixture that hard-codes Limits::default() panics with LimitsExceeded there even though the production path — which always requests the adapter’s own limits — never would. Every fixture already probes TierCaps::probe(&adapter) before requesting its device, so caps is available at the same call site this replaces.

Public (not test-only/#[cfg(test)]) because the fixtures that need it live in other crates’ tests/ integration binaries and frust-testing’s own EngineOracle, none of which can reach a #[cfg(test)] item in this crate.