pub trait PhysicalDevice<B>:
Debug
+ Any
+ Send
+ Syncwhere
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§
Sourceunsafe fn open(
&self,
families: &[(&<B as Backend>::QueueFamily, &[f32])],
requested_features: Features,
) -> Result<Gpu<B>, CreationError>
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
TooManyObjectsif the implementation can’t create a new logical device. - Returns
MissingFeatureif 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());Sourcefn format_properties(&self, format: Option<Format>) -> Properties
fn format_properties(&self, format: Option<Format>) -> Properties
Fetch details for a particular format.
Sourcefn image_format_properties(
&self,
format: Format,
dimensions: u8,
tiling: Tiling,
usage: Usage,
view_caps: ViewCapabilities,
) -> Option<FormatProperties>
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.
Sourcefn memory_properties(&self) -> MemoryProperties
fn memory_properties(&self) -> MemoryProperties
Fetch details for the memory regions provided by the device.
Provided Methods§
Sourcefn is_valid_cache(&self, _cache: &[u8]) -> bool
fn is_valid_cache(&self, _cache: &[u8]) -> bool
Check cache compatibility with the Device.