Device

Struct Device 

Source
pub struct Device { /* private fields */ }
Expand description

Device is the main struct used for creation of graphics resources and using this wrapper

Implementations§

Source§

impl Device

Source

pub fn compute() -> GraphicsResult<Self>

Initializes device with no presentation support

Source

pub fn graphics<T: HasWindowHandle + HasDisplayHandle>( settings: &GraphicsApiInitSettings, window: &T, ) -> GraphicsResult<Self>

Initializes device with presentation support

Source

pub fn dispatch_and_present( &self, objects: &[Arc<Object>], ) -> GraphicsResult<()>

Executes all operations permitted with objects passed in this method

Source

pub fn dispatch_compute(&self, objects: &[Arc<Object>]) -> GraphicsResult<()>

Executes all compute operations permitted with objects passed in this method

Source

pub fn resize_resources(&self, width: u32, height: u32) -> GraphicsResult<()>

Resizes resources

Source

pub fn get_presentation_render_target(&self) -> Option<RenderTarget>

Returns RenderTarget created on presentation init

Source

pub fn create_layout( &self, double_buffering: bool, texture_num: usize, sampler_num: usize, uniform_num: usize, storage_num: usize, ) -> GraphicsResult<Layout>

Creates shader layout

Source

pub fn create_buffer<T>( &self, len: u64, flags: BufferFlags, ) -> GraphicsResult<Buffer<T>>

Creates GPU buffer

Source

pub fn create_buffer_mesh<V: AttributeDescriptor, I>( &self, mesh: &Mesh<V, I>, ) -> GraphicsResult<MeshBuffer<V, I>>

Creates a set of GPU buffers used for meshes

Source

pub fn create_sampler_set( &self, textures: &[(u32, &Texture)], layouts: &[&Layout], ) -> GraphicsResult<Arc<GpuSamplerSet>>

Creates sampler set

Source

pub fn create_texture( &self, buffer: &Buffer<u8>, extent: [u32; 2], anisotropy_texels: f32, ) -> GraphicsResult<Texture>

Creates texture from buffers

Source

pub fn get_delta_time(&self) -> Duration

Returns the duration of previous frame

Auto Trait Implementations§

§

impl Freeze for Device

§

impl !RefUnwindSafe for Device

§

impl Send for Device

§

impl Sync for Device

§

impl Unpin for Device

§

impl !UnwindSafe for Device

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.