Trait PhysicalDevice

Source
pub trait PhysicalDevice<B>:
    Debug
    + Any
    + Send
    + Sync
where B: Backend,
{ // Required methods unsafe fn open( &self, families: &[(&<B as Backend>::QueueFamily, &[f32])], requested_features: Features, ) -> Result<Gpu<B>, CreationError>; fn format_properties(&self, format: Option<Format>) -> Properties; fn image_format_properties( &self, format: Format, dimensions: u8, tiling: Tiling, usage: Usage, view_caps: ViewCapabilities, ) -> Option<FormatProperties>; fn memory_properties(&self) -> MemoryProperties; fn features(&self) -> Features; fn limits(&self) -> Limits; // Provided method fn is_valid_cache(&self, _cache: &[u8]) -> bool { ... } }
Expand description

Represents a physical device (such as a GPU) capable of supporting the given backend.

Required Methods§

Source

unsafe fn open( &self, families: &[(&<B as Backend>::QueueFamily, &[f32])], requested_features: Features, ) -> Result<Gpu<B>, CreationError>

Create a new logical device with the requested features. If requested_features is empty (e.g. through Features::empty()) then only the core features are supported.

§Errors
  • Returns TooManyObjects if the implementation can’t create a new logical device.
  • Returns MissingFeature if the implementation does not support a requested feature.
§Examples
use gfx_hal::{adapter::PhysicalDevice, Features};

let gpu = physical_device.open(&[(&family, &[1.0; 1])], Features::empty());
Source

fn format_properties(&self, format: Option<Format>) -> Properties

Fetch details for a particular format.

Source

fn image_format_properties( &self, format: Format, dimensions: u8, tiling: Tiling, usage: Usage, view_caps: ViewCapabilities, ) -> Option<FormatProperties>

Fetch details for a particular image format.

Source

fn memory_properties(&self) -> MemoryProperties

Fetch details for the memory regions provided by the device.

Source

fn features(&self) -> Features

Returns the features of this Device. This usually depends on the graphics API being used.

Source

fn limits(&self) -> Limits

Returns the resource limits of this Device.

Provided Methods§

Source

fn is_valid_cache(&self, _cache: &[u8]) -> bool

Check cache compatibility with the Device.

Implementors§