Skip to main content

Gpu

Struct Gpu 

Source
pub struct Gpu;

Implementations§

Source§

impl Gpu

Source

pub fn begin_frame(&self)

Source

pub fn get_surface_format(&self) -> TextureFormat

Source

pub fn get_current_surface_texture(&self) -> u32

Source

pub fn present(&self)

Source

pub fn create_buffer( &self, size: u64, usage: BufferUsage, mapped_at_creation: bool, ) -> u32

Source

pub fn write_buffer(&self, buffer: u32, offset: u64, data: Vec<u8>)

Source

pub fn destroy_buffer(&self, id: u32)

Source

pub fn create_texture(&self, desc: CreateTexture) -> u32

Source

pub fn create_texture_view(&self, desc: CreateTextureView) -> u32

Source

pub fn destroy_texture(&self, id: u32)

Source

pub fn create_shader_module(&self, wgsl_source: String) -> u32

Source

pub fn create_bind_group_layout(&self, desc: CreateBindGroupLayout) -> u32

Source

pub fn create_bind_group(&self, desc: CreateBindGroup) -> u32

Source

pub fn create_pipeline_layout(&self, desc: CreatePipelineLayout) -> u32

Source

pub fn create_render_pipeline(&self, desc: CreateRenderPipeline) -> u32

Source

pub fn create_compute_pipeline(&self, desc: CreateComputePipeline) -> u32

Source

pub fn create_command_encoder(&self) -> u32

Source

pub fn submit(&self, encoder: u32)

Source

pub fn begin_render_pass(&self, desc: BeginRenderPass) -> u32

Source

pub fn end_render_pass(&self, pass: u32)

Source

pub fn set_render_pipeline(&self, pass: u32, pipeline: u32)

Source

pub fn set_bind_group(&self, pass: u32, index: u32, bind_group: u32)

Source

pub fn set_vertex_buffer( &self, pass: u32, buffer: u32, offset: u64, slot: u32, size: Option<u64>, )

Source

pub fn set_index_buffer( &self, pass: u32, buffer: u32, offset: u64, format: IndexFormat, size: Option<u64>, )

Source

pub fn draw(&self, pass: u32, vertices: u32, instances: u32)

Source

pub fn draw_indexed(&self, pass: u32, indices: u32, instances: u32)

Source

pub fn begin_compute_pass(&self, encoder: u32) -> u32

Source

pub fn end_compute_pass(&self, pass: u32)

Source

pub fn set_compute_pipeline(&self, pass: u32, pipeline: u32)

Source

pub fn dispatch(&self, pass: u32, x: u32, y: u32, z: u32)

Source

pub fn copy_buffer_to_buffer(&self, cmd: CopyBufferToBuffer)

Source

pub fn copy_buffer_to_texture(&self, cmd: CopyBufferToTexture)

Source

pub fn copy_texture_to_buffer(&self, cmd: CopyTextureToBuffer)

Auto Trait Implementations§

§

impl Freeze for Gpu

§

impl RefUnwindSafe for Gpu

§

impl Send for Gpu

§

impl Sync for Gpu

§

impl Unpin for Gpu

§

impl UnwindSafe for Gpu

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.