Struct wgpu_biolerless::State
source · [−]pub struct State { /* private fields */ }Implementations
sourceimpl State
impl State
sourcepub async fn new<T: WindowSize>(builder: StateBuilder<T>) -> Result<Self>
pub async fn new<T: WindowSize>(builder: StateBuilder<T>) -> Result<Self>
Tries to create a new State from a StateBuilder
returns either the newly created state or an error if requesting an adapter or device fails.
sourcepub fn create_pipeline_layout(
&self,
bind_group_layouts: &[&BindGroupLayout],
push_constant_ranges: &[PushConstantRange]
) -> PipelineLayout
pub fn create_pipeline_layout(
&self,
bind_group_layouts: &[&BindGroupLayout],
push_constant_ranges: &[PushConstantRange]
) -> PipelineLayout
Creates a new pipeline layout from its bind group layouts and its push constant ranges
sourcepub fn create_pipeline(&self, builder: PipelineBuilder<'_>) -> RenderPipeline
pub fn create_pipeline(&self, builder: PipelineBuilder<'_>) -> RenderPipeline
Helper method to create a pipeline from its builder
sourcepub fn create_shader(&self, src: ShaderSource<'_>) -> ShaderModule
pub fn create_shader(&self, src: ShaderSource<'_>) -> ShaderModule
Creates a shader module from its src
sourcepub fn resize(&self, size: impl Into<(u32, u32)>) -> bool
pub fn resize(&self, size: impl Into<(u32, u32)>) -> bool
Returns whether the resizing succeeded or not
sourcepub fn render<F: FnOnce(TextureView, CommandEncoder, &State) -> CommandEncoder>(
&self,
callback: F
) -> Result<(), SurfaceError>
pub fn render<F: FnOnce(TextureView, CommandEncoder, &State) -> CommandEncoder>(
&self,
callback: F
) -> Result<(), SurfaceError>
Initiates the rendering process, the passed callback gets called once all the required state is set up and once it ran, all the required steps to proceed get executed
sourcepub fn create_render_pass<'a>(
&self,
encoder: &'a mut CommandEncoder,
color_attachments: &'a [Option<RenderPassColorAttachment<'a>>],
depth_stencil_attachment: Option<RenderPassDepthStencilAttachment<'a>>
) -> RenderPass<'a>
pub fn create_render_pass<'a>(
&self,
encoder: &'a mut CommandEncoder,
color_attachments: &'a [Option<RenderPassColorAttachment<'a>>],
depth_stencil_attachment: Option<RenderPassDepthStencilAttachment<'a>>
) -> RenderPass<'a>
Helper method to create a render pass in the encoder
sourcepub fn try_update_present_mode(&self, present_mode: PresentMode) -> bool
pub fn try_update_present_mode(&self, present_mode: PresentMode) -> bool
Tries to update the present mode of the surface. Returns whether update succeeded or not
sourcepub fn update_present_mode(&self, present_mode: PresentMode)
pub fn update_present_mode(&self, present_mode: PresentMode)
Updates the present mode of the surface Note: this function will wait until the render call has finished
sourcepub const fn adapter(&self) -> &Adapter
pub const fn adapter(&self) -> &Adapter
Returns a reference to the adapter which can be used to acquire information
sourcepub fn create_buffer<T: Pod>(&self, content: &[T], usage: BufferUsages) -> Buffer
pub fn create_buffer<T: Pod>(&self, content: &[T], usage: BufferUsages) -> Buffer
Helper method to create a buffer from its content and usage
sourcepub fn create_texture(&self, builder: TextureBuilder<'_>) -> Texture
pub fn create_texture(&self, builder: TextureBuilder<'_>) -> Texture
Helper method to create a texture from its builder
sourcepub fn create_bind_group_layout(
&self,
entries: &[BindGroupLayoutEntry]
) -> BindGroupLayout
pub fn create_bind_group_layout(
&self,
entries: &[BindGroupLayoutEntry]
) -> BindGroupLayout
Helper method to create a BindGroupLayoutEntry from its entries
sourcepub fn create_bind_group(
&self,
layout: &BindGroupLayout,
entries: &[BindGroupEntry<'_>]
) -> BindGroup
pub fn create_bind_group(
&self,
layout: &BindGroupLayout,
entries: &[BindGroupEntry<'_>]
) -> BindGroup
Helper method to create a BindGroup from its layout and entries
sourcepub fn write_buffer<T: Pod>(
&self,
buffer: &Buffer,
offset: BufferAddress,
data: &[T]
)
pub fn write_buffer<T: Pod>(
&self,
buffer: &Buffer,
offset: BufferAddress,
data: &[T]
)
Helper method to write data to a buffer at a specific offset
sourcepub fn create_depth_texture(&self, format: TextureFormat) -> Texture
pub fn create_depth_texture(&self, format: TextureFormat) -> Texture
Helper method to create a depth texture from its format
Auto Trait Implementations
impl !RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl !UnwindSafe for State
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more