[][src]Trait gfx_hal::adapter::PhysicalDevice

pub trait PhysicalDevice<B: Backend>: Debug + Any + Send + Sync {
    unsafe fn open(
        &self,
        families: &[(&B::QueueFamily, &[QueuePriority])],
        requested_features: Features
    ) -> Result<Gpu<B>, DeviceCreationError>;
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; fn is_valid_cache(&self, _cache: &[u8]) -> bool { ... } }

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

Required methods

unsafe fn open(
    &self,
    families: &[(&B::QueueFamily, &[QueuePriority])],
    requested_features: Features
) -> Result<Gpu<B>, DeviceCreationError>

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::{PhysicalDevice, Features};

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

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

Fetch details for a particular format.

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.

fn memory_properties(&self) -> MemoryProperties

Fetch details for the memory regions provided by the device.

fn features(&self) -> Features

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

fn limits(&self) -> Limits

Returns the resource limits of this Device.

Loading content...

Provided methods

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

Check cache compatibility with the Device.

Loading content...

Implementors

Loading content...