Struct RenderApi
pub struct RenderApi { /* private fields */ }Implementations§
§impl RenderApi
impl RenderApi
pub fn new( window: impl HasWindowHandle + HasDisplayHandle + Send + Sync + 'static, size: [usize; 2], ) -> Option<RenderApi>
pub fn clone(&self) -> RenderApi
pub fn surface_size(&self) -> [usize; 2]
pub fn resize_surface(&self, size: [usize; 2])
pub fn create_vertex_buffer( &self, label: Option<&str>, len: usize, layout: GpuVertexBufferLayout, ) -> GpuVertexBuffer
pub fn create_uniform_storage_buffer( &self, label: Option<&str>, size: usize, ) -> GpuUniformStorageBuffer
pub fn create_index_buffer( &self, label: Option<&str>, len: usize, ) -> GpuIndexBuffer
pub fn create_texture( &self, label: Option<&str>, size: [usize; 2], format: GpuTextureFormat, mip_level_count: usize, ) -> GpuTexture
pub fn create_sampler( &self, label: Option<&str>, filter: GpuFilterMode, ) -> GpuSampler
pub fn create_comparison_sampler( &self, label: Option<&str>, filter: GpuFilterMode, compare: GpuCompareFunction, ) -> GpuSampler
pub fn create_shader( &self, label: Option<&str>, wgsl: &str, desc: GpuShaderDesc, ) -> Option<GpuShader>
pub fn write_vertex_buffer_with( &self, buffer: &GpuVertexBuffer, offset: usize, size: usize, writer: impl FnOnce(&mut [u8]), ) -> bool
pub fn write_uniform_storage_buffer_with( &self, buffer: &GpuUniformStorageBuffer, offset: usize, size: usize, writer: impl FnOnce(&mut [u8]), ) -> bool
pub fn write_index_buffer_with( &self, buffer: &GpuIndexBuffer, offset: usize, size: usize, writer: impl FnOnce(&mut [u8]), ) -> bool
pub fn write_texture( &self, texture: &GpuTexture, mip_level: usize, data: &[u8], ) -> bool
pub fn draw( &self, pass: &GpuRenderPass<'_>, vertices: Range<usize>, instances: Range<usize>, ) -> bool
pub fn draw_indexed( &self, pass: &GpuRenderPass<'_>, index_buffer: &GpuIndexBuffer, indices: Range<usize>, instances: Range<usize>, ) -> bool
pub fn draw_to_surface( &self, pass: &GpuRenderPass<'_>, ops: GpuPassOps<[f32; 4]>, vertices: Range<usize>, instances: Range<usize>, ) -> bool
pub fn clear_color_texture( &self, texture: &GpuTexture, mip_level: usize, color: [f32; 4], ) -> bool
pub fn clear_depth_texture( &self, texture: &GpuTexture, mip_level: usize, depth: f32, ) -> bool
pub fn copy_texture(&self, src: &GpuTexture, dst: &GpuTexture) -> bool
pub fn read_texture( &self, texture: &GpuTexture, mip_level: usize, ) -> Option<FfiVec<u8>>
Trait Implementations§
Auto Trait Implementations§
impl Forget for RenderApi
impl Freeze for RenderApi
impl Move for RenderApi
impl RefUnwindSafe for RenderApi
impl Unpin for RenderApi
impl UnsafeUnpin for RenderApi
impl UnwindSafe for RenderApi
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more