pub struct TierCaps {Show 15 fields
pub downlevel_flags: DownlevelFlags,
pub adapter_name: String,
pub backend: Backend,
pub max_texture_dimension_2d: u32,
pub max_texture_array_layers: u32,
pub max_bind_groups: u32,
pub max_uniform_buffer_binding_size: u32,
pub min_uniform_buffer_offset_alignment: u32,
pub max_vertex_attributes: u32,
pub has_storage_buffers: bool,
pub has_timestamp_query: bool,
pub transient_saves_memory: bool,
pub atlas_format: TextureFormat,
pub resource_texture_dim: u32,
pub downlevel_profile: DownlevelProfile,
}Expand description
Plain-data adapter capabilities the GPU crate’s device/pipeline/atlas
decisions are built over. Constructed from a real wgpu::Adapter via
TierCaps::probe, or by hand in host tests via TierCaps::fake.
Fields§
§downlevel_flags: DownlevelFlagsThe adapter’s wgpu::DownlevelCapabilities::flags.
adapter_name: StringThe adapter’s wgpu::AdapterInfo::name, used only for diagnostics.
backend: BackendThe adapter’s wgpu::AdapterInfo::backend.
max_texture_dimension_2d: u32The adapter’s wgpu::Limits::max_texture_dimension_2d, clamped down to
wgpu::Limits::downlevel_webgl2_defaults().max_texture_dimension_2d
when Self::downlevel_profile is DownlevelProfile::WebGl2.
max_texture_array_layers: u32The adapter’s wgpu::Limits::max_texture_array_layers, clamped the
same way as Self::max_texture_dimension_2d.
max_bind_groups: u32The adapter’s wgpu::Limits::max_bind_groups, clamped the same way as
Self::max_texture_dimension_2d.
max_uniform_buffer_binding_size: u32The adapter’s wgpu::Limits::max_uniform_buffer_binding_size,
saturated into a u32 (the field is u64 on wgpu::Limits; no
adapter this workspace targets reports a value anywhere near
u32::MAX) and clamped the same way as
Self::max_texture_dimension_2d.
min_uniform_buffer_offset_alignment: u32The adapter’s wgpu::Limits::min_uniform_buffer_offset_alignment,
raised to
wgpu::Limits::downlevel_webgl2_defaults().min_uniform_buffer_offset_alignment
(256) when Self::downlevel_profile is DownlevelProfile::WebGl2
and the adapter reports a looser (smaller) value — an alignment
requirement is a floor, so it is only ever raised, never lowered.
max_vertex_attributes: u32The adapter’s wgpu::Limits::max_vertex_attributes, clamped the same
way as Self::max_texture_dimension_2d.
has_storage_buffers: boolWhether the adapter supports storage buffers at all
(wgpu::Limits::max_storage_buffers_per_shader_stage > 0) — forced
false whenever Self::downlevel_profile is
DownlevelProfile::WebGl2, since the GLES-3.0/WebGL2 downlevel
default limits report zero storage buffers per shader stage.
has_timestamp_query: boolWhether the adapter exposes wgpu::Features::TIMESTAMP_QUERY.
transient_saves_memory: boolThe adapter’s wgpu::AdapterInfo::transient_saves_memory — whether
adding wgpu::TextureUsages::TRANSIENT_ATTACHMENT to a texture (which
itself requires wgpu::StoreOp::Discard) reduces memory usage on this
adapter.
wgpu reports this as Option<bool>, where None means “the adapter
does not say” (only the web backend, which no frust shell targets).
Self::probe folds None to false: an unknown answer must not buy
the transient flag, since it is a memory optimization with a hard
clear/discard precondition and no upside when the driver ignores it.
atlas_format: TextureFormatThe texture format a texture atlas is backed by.
resource_texture_dim: u32The texture dimension a pooled/atlas resource texture is sized
against: min(max_texture_dimension_2d, 4096) against the (possibly
already WebGL2-clamped) Self::max_texture_dimension_2d, so a very
generous desktop adapter’s real ceiling never drives an oversized
allocation.
downlevel_profile: DownlevelProfileWhether this adapter’s usable limits are the full native set or clamped to the GLES-3.0/WebGL2 downlevel defaults.
Implementations§
Source§impl TierCaps
impl TierCaps
Sourcepub fn probe(adapter: &Adapter) -> Self
pub fn probe(adapter: &Adapter) -> Self
Probes a real wgpu::Adapter for the capabilities this crate’s
device/pipeline/atlas decisions are built over. Synchronous: every
value it reads (get_info, get_downlevel_capabilities, limits,
features) is available before device creation.
When the resolved DownlevelProfile is DownlevelProfile::WebGl2
— a real wgpu::Backend::Gl adapter, or FRUST_ENGINE_DOWNLEVEL=1
rehearsing it against a desktop backend — the probed limits are run
through clamp_to_webgl2_defaults and storage buffers are forced
off, so the override actually rehearses the downlevel shape instead of
only relabelling desktop values.
Sourcepub fn fake(profile: DownlevelProfile) -> Self
pub fn fake(profile: DownlevelProfile) -> Self
Builds synthetic caps for the given DownlevelProfile with no
wgpu::Adapter at all — the host-test counterpart to Self::probe.
Full mirrors wgpu::Limits::defaults()’s desktop values (backend
Vulkan, max_texture_dimension_2d 8192, storage buffers present);
WebGl2 mirrors wgpu::Limits::downlevel_webgl2_defaults() (backend
Gl, max_texture_dimension_2d 2048, no storage buffers).
Trait Implementations§
impl Eq for TierCaps
impl StructuralPartialEq for TierCaps
Auto Trait Implementations§
impl Freeze for TierCaps
impl RefUnwindSafe for TierCaps
impl Send for TierCaps
impl Sync for TierCaps
impl Unpin for TierCaps
impl UnsafeUnpin for TierCaps
impl UnwindSafe for TierCaps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.