Skip to main content

DeviceCapabilities

Struct DeviceCapabilities 

Source
pub struct DeviceCapabilities {
    pub preferred_surface_format: TextureFormat,
    pub preferred_render_target_format: TextureFormat,
    pub supported_surface_formats: Vec<TextureFormat>,
    pub supported_render_target_formats: Vec<TextureFormat>,
    pub has_zero_copy_storage_readback: bool,
    pub buffer_resize_cost: BufferResizeCost,
    pub buffer_page_size: u64,
    pub buffer_decommit_supported: bool,
    pub host_sidecar_on_submit_worker: bool,
    pub split_compute_partitions_on_barrier_cost: bool,
    pub fuse_upload_with_compute_partitions: bool,
}
Expand description

Device capabilities and format preferences.

Use this to query the optimal formats and limits for your use case.

Fields§

§preferred_surface_format: TextureFormat

Preferred format for window surfaces (swapchains). For windowed apps, use this for RenderPipelineDesc::target_format.

§preferred_render_target_format: TextureFormat

Preferred format for off-screen render targets. For headless rendering (video encoding, CPU readback), use this format.

§supported_surface_formats: Vec<TextureFormat>

Formats supported for window surfaces.

§supported_render_target_formats: Vec<TextureFormat>

Formats supported for render targets.

§has_zero_copy_storage_readback: bool

Whether crate::types::BufferFlags::CPU_READABLE scattered buffers can be read from CPU without a GPU copy.

true on Vulkan (HOST_VISIBLE storage) and Metal (Shared storage). false on Direct3D 12 (requires GPU copy to a READBACK heap).

§buffer_resize_cost: BufferResizeCost

How costly in-place buffer resize (resize_to) is on this device.

§buffer_page_size: u64

Sparse / tile page size when applicable; informational for aligning resize hints.

§buffer_decommit_supported: bool

Whether hint_unused_above on backing buffer allocations can return physical memory to the system.

§host_sidecar_on_submit_worker: bool

Whether crate::Scheme::defer_host_write / host-observed waits are applied on the submission worker before GPU execute (DX12, Vulkan, and Metal).

When false, callers must keep synchronous host writes and render-thread reuse gates.

§split_compute_partitions_on_barrier_cost: bool

Whether large pure-compute partitions may be subdivided at their heaviest barrier boundary to expose GPU-pipeline overlap between submissions.

Enabled on Vulkan/DX12. Disabled on Metal: cross-CB MTLSharedEvent waits serialize consecutive partitions and dominate any overlap gains.

§fuse_upload_with_compute_partitions: bool

Whether the fresh Scheme submit path may fuse an upload-only partition with the immediately following compute partition into one command buffer.

Enabled on Metal so blit uploads and compute dispatches share one MTLCommandBuffer (blit encoder → compute encoder). Disabled elsewhere: upload and compute partitions remain separate submissions.

Trait Implementations§

Source§

impl Clone for DeviceCapabilities

Source§

fn clone(&self) -> DeviceCapabilities

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DeviceCapabilities

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more