gfx_backend_vulkan

Struct Instance

Source
pub struct Instance {
    pub raw: Arc<RawInstance>,
    pub extensions: Vec<&'static CStr>,
    pub entry: Entry,
}

Fields§

§raw: Arc<RawInstance>§extensions: Vec<&'static CStr>

Supported extensions of this instance.

§entry: Entry

Implementations§

Source§

impl Instance

Source

pub fn create_surface_from_xlib( &self, dpy: *mut Display, window: Window, ) -> Surface

Source

pub fn create_surface_from_xcb( &self, connection: *mut xcb_connection_t, window: xcb_window_t, ) -> Surface

Source

pub fn create_surface_from_wayland( &self, display: *mut c_void, surface: *mut c_void, ) -> Surface

Source

pub fn create_surface_from_vk_surface_khr(&self, surface: SurfaceKHR) -> Surface

Source§

impl Instance

Source

pub fn required_extensions( entry: &Entry, driver_api_version: Version, ) -> Result<Vec<&'static CStr>, UnsupportedBackend>

Source

pub fn required_layers( entry: &Entry, ) -> Result<Vec<&'static CStr>, UnsupportedBackend>

Source

pub unsafe fn from_raw( entry: Entry, raw_instance: Instance, driver_api_version: Version, extensions: Vec<&'static CStr>, ) -> Result<Self, UnsupportedBackend>

§Safety

raw_instance must be created using at least the extensions provided by Instance::required_extensions() and the layers provided by Instance::required_extensions(). driver_api_version must match the version used to create raw_instance. extensions must match the extensions used to create raw_instance. raw_instance must be manually destroyed after gfx-hal Instance has been dropped.

Source

pub unsafe fn adapter_from_raw( &self, raw_physical_device: PhysicalDevice, ) -> Adapter<Backend>

§Safety

raw_physical_device must be created from self (or from the inner raw handle)

Trait Implementations§

Source§

impl Debug for Instance

Source§

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

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

impl Instance<Backend> for Instance

Source§

fn create(name: &str, version: u32) -> Result<Self, UnsupportedBackend>

Create a new instance. Read more
Source§

fn enumerate_adapters(&self) -> Vec<Adapter<Backend>>

Return all available graphics adapters.
Source§

unsafe fn create_surface( &self, has_handle: &impl HasRawWindowHandle, ) -> Result<Surface, InitError>

Create a new surface. Read more
Source§

unsafe fn destroy_surface(&self, surface: Surface)

Destroy a surface, freeing the resources associated with it and releasing it from this graphics API. Read more
Source§

unsafe fn create_display_plane_surface( &self, display_plane: &DisplayPlane<'_, Backend>, plane_stack_index: u32, transformation: SurfaceTransform, alpha: DisplayPlaneAlpha, image_extent: Extent2D, ) -> Result<Surface, DisplayPlaneSurfaceError>

Create a new surface from a display plane. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.