Skip to main content

Gpu

Struct Gpu 

Source
pub struct Gpu;

Implementations§

Source§

impl Gpu

Source

pub fn request_redraw(&self) -> Result<(), String>

Source

pub fn begin_frame(&self) -> Result<(), String>

Source

pub fn get_surface_format(&self) -> Result<TextureFormat, String>

Source

pub fn get_surface_size(&self) -> Result<(u32, u32), String>

Source

pub fn get_current_surface_texture(&self) -> Result<u32, String>

Source

pub fn present(&self) -> Result<(), String>

Source

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

Source

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

Source

pub fn write_texture(&self, desc: WriteTexture) -> Result<(), String>

Source

pub fn destroy_buffer(&self, id: u32) -> Result<(), String>

Source

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

Source

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

Source

pub fn destroy_texture(&self, id: u32) -> Result<(), String>

Source

pub fn destroy_texture_view(&self, id: u32) -> Result<(), String>

Source

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

Source

pub fn destroy_shader_module(&self, id: u32) -> Result<(), String>

Source

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

Source

pub fn destroy_bind_group_layout(&self, id: u32) -> Result<(), String>

Source

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

Source

pub fn destroy_bind_group(&self, id: u32) -> Result<(), String>

Source

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

Source

pub fn destroy_pipeline_layout(&self, id: u32) -> Result<(), String>

Source

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

Source

pub fn destroy_render_pipeline(&self, id: u32) -> Result<(), String>

Source

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

Source

pub fn destroy_compute_pipeline(&self, id: u32) -> Result<(), String>

Source

pub fn create_command_encoder(&self) -> Result<u32, String>

Source

pub fn submit(&self, encoder: u32) -> Result<(), String>

Source

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

Source

pub fn end_render_pass(&self, pass: u32) -> Result<(), String>

Source

pub fn set_render_pipeline( &self, pass: u32, pipeline: u32, ) -> Result<(), String>

Source

pub fn set_bind_group( &self, pass: u32, index: u32, bind_group: u32, ) -> Result<(), String>

Source

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

Source

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

Source

pub fn draw( &self, pass: u32, vertices: u32, instances: u32, ) -> Result<(), String>

Source

pub fn draw_indexed( &self, pass: u32, indices: u32, instances: u32, ) -> Result<(), String>

Source

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

Source

pub fn end_compute_pass(&self, pass: u32) -> Result<(), String>

Source

pub fn set_compute_pipeline( &self, pass: u32, pipeline: u32, ) -> Result<(), String>

Source

pub fn dispatch(&self, pass: u32, x: u32, y: u32, z: u32) -> Result<(), String>

Source

pub fn copy_buffer_to_buffer( &self, cmd: CopyBufferToBuffer, ) -> Result<(), String>

Source

pub fn copy_buffer_to_texture( &self, cmd: CopyBufferToTexture, ) -> Result<(), String>

Source

pub fn copy_texture_to_buffer( &self, cmd: CopyTextureToBuffer, ) -> Result<(), String>

Auto Trait Implementations§

§

impl Freeze for Gpu

§

impl RefUnwindSafe for Gpu

§

impl Send for Gpu

§

impl Sync for Gpu

§

impl Unpin for Gpu

§

impl UnsafeUnpin 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.