pub struct Adapter { /* private fields */ }
Available on
vulkan
only.Implementations§
source§impl Adapter
impl Adapter
pub fn raw_physical_device(&self) -> PhysicalDevice
pub fn physical_device_capabilities(&self) -> &PhysicalDeviceProperties
pub fn required_device_extensions( &self, features: Features ) -> Vec<&'static CStr>
sourcepub fn physical_device_features(
&self,
enabled_extensions: &[&'static CStr],
features: Features
) -> PhysicalDeviceFeatures
pub fn physical_device_features( &self, enabled_extensions: &[&'static CStr], features: Features ) -> PhysicalDeviceFeatures
Create a PhysicalDeviceFeatures
for opening a logical device with
features
from this adapter.
The given enabled_extensions
set must include all the extensions
selected by required_device_extensions
when passed features
.
Otherwise, the PhysicalDeviceFeatures
value may not be able to select
all the Vulkan features needed to represent features
and this
adapter’s characteristics.
Typically, you’d simply call required_device_extensions
, and then pass
its return value and the feature set you gave it directly to this
function. But it’s fine to add more extensions to the list.
sourcepub unsafe fn device_from_raw(
&self,
raw_device: Device,
drop_callback: Option<DropCallback>,
enabled_extensions: &[&'static CStr],
features: Features,
memory_hints: &MemoryHints,
family_index: u32,
queue_index: u32
) -> Result<OpenDevice<Api>, DeviceError>
pub unsafe fn device_from_raw( &self, raw_device: Device, drop_callback: Option<DropCallback>, enabled_extensions: &[&'static CStr], features: Features, memory_hints: &MemoryHints, family_index: u32, queue_index: u32 ) -> Result<OpenDevice<Api>, DeviceError>
Safety
raw_device
must be created from this adapter.raw_device
must be created usingfamily_index
,enabled_extensions
andphysical_device_features()
enabled_extensions
must be a superset ofrequired_device_extensions()
.- If
drop_callback
isNone
, wgpu-hal will take ownership ofraw_device
. Ifdrop_callback
isSome
,raw_device
must be valid until the callback is called.
Trait Implementations§
source§impl Adapter for Adapter
impl Adapter for Adapter
type A = Api
unsafe fn open( &self, features: Features, _limits: &Limits, memory_hints: &MemoryHints ) -> Result<OpenDevice<Api>, DeviceError>
source§unsafe fn texture_format_capabilities(
&self,
format: TextureFormat
) -> TextureFormatCapabilities
unsafe fn texture_format_capabilities( &self, format: TextureFormat ) -> TextureFormatCapabilities
Return the set of supported capabilities for a texture format.
source§unsafe fn surface_capabilities(
&self,
surface: &Surface
) -> Option<SurfaceCapabilities>
unsafe fn surface_capabilities( &self, surface: &Surface ) -> Option<SurfaceCapabilities>
Returns the capabilities of working with a specified surface. Read more
source§unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp
unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp
Creates a
PresentationTimestamp
using the adapter’s WSI.Auto Trait Implementations§
impl !RefUnwindSafe for Adapter
impl Send for Adapter
impl Sync for Adapter
impl Unpin for Adapter
impl !UnwindSafe for Adapter
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
Mutably borrows from an owned value. Read more