Struct bgfx_rs::static_lib::Encoder

source ·
#[repr(C)]
pub struct Encoder {}
Expand description

Encoders are used for submitting draw calls from multiple threads. Only one encoder per thread should be used. Use bgfx::begin() to obtain an encoder for a thread.

Implementations§

source§

impl Encoder

source

pub fn new() -> Encoder

source

pub fn set_marker(&self, marker: *const i8)

  • marker: Marker string.
source

pub fn set_state(&self, state: u64, rgba: u32)

source

pub fn set_condition(&self, handle: &OcclusionQuery, visible: bool)

  • handle: Occlusion query handle.
  • visible: Render if occlusion query is visible.
source

pub fn set_stencil(&self, fstencil: u32, bstencil: u32)

  • fstencil: Front stencil state.
  • bstencil: Back stencil state. If back is set to StencilFlags::NONE _fstencil is applied to both front and back facing primitives.
source

pub fn set_scissor(&self, x: u16, y: u16, width: u16, height: u16) -> u16

  • x: Position x from the left corner of the window.
  • y: Position y from the top corner of the window.
  • width: Width of view scissor region.
  • height: Height of view scissor region.
source

pub fn set_scissor_cached(&self, cache: u16)

  • cache: Index in scissor cache.
source

pub fn alloc_transform(&self, transform: &mut Transform, num: u16) -> u32

  • transform: Pointer to Transform structure.
  • num: Number of matrices.
source

pub fn set_index_buffer( &self, handle: &IndexBuffer, first_index: u32, num_indices: u32 )

  • handle: Index buffer.
  • first_index: First index to render.
  • num_indices: Number of indices to render.
source

pub fn set_dynamic_index_buffer( &self, handle: &DynamicIndexBuffer, first_index: u32, num_indices: u32 )

  • handle: Dynamic index buffer.
  • first_index: First index to render.
  • num_indices: Number of indices to render.
source

pub fn set_transient_index_buffer( &self, tib: &TransientIndexBuffer, first_index: u32, num_indices: u32 )

  • tib: Transient index buffer.
  • first_index: First index to render.
  • num_indices: Number of indices to render.
source

pub fn set_vertex_buffer( &self, stream: u8, handle: &VertexBuffer, start_vertex: u32, num_vertices: u32 )

  • stream: Vertex stream.
  • handle: Vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
source

pub fn set_vertex_buffer_with_layout( &self, stream: u8, handle: &VertexBuffer, start_vertex: u32, num_vertices: u32, layout_handle: &VertexLayout )

  • stream: Vertex stream.
  • handle: Vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • layout_handle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
source

pub fn set_dynamic_vertex_buffer( &self, stream: u8, handle: &DynamicVertexBuffer, start_vertex: u32, num_vertices: u32 )

  • stream: Vertex stream.
  • handle: Dynamic vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render. Vertex stream. Dynamic vertex buffer. First vertex to render. Number of vertices to render. Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
source

pub fn set_dynamic_vertex_buffer_with_layout( &self, stream: u8, handle: &DynamicVertexBuffer, start_vertex: u32, num_vertices: u32, layout_handle: &VertexLayout )

  • stream: Vertex stream.
  • handle: Dynamic vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • layout_handle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
source

pub fn set_transient_vertex_buffer( &self, stream: u8, tvb: &TransientVertexBuffer, start_vertex: u32, num_vertices: u32 )

  • stream: Vertex stream.
  • tvb: Transient vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
source

pub fn set_transient_vertex_buffer_with_layout( &self, stream: u8, tvb: &TransientVertexBuffer, start_vertex: u32, num_vertices: u32, layout_handle: &VertexLayout )

  • stream: Vertex stream.
  • tvb: Transient vertex buffer.
  • start_vertex: First vertex to render.
  • num_vertices: Number of vertices to render.
  • layout_handle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.
source

pub fn set_vertex_count(&self, num_vertices: u32)

  • num_vertices: Number of vertices.
source

pub fn set_instance_data_buffer( &self, idb: &InstanceDataBuffer, start: u32, num: u32 )

  • idb: Transient instance data buffer.
  • start: First instance data.
  • num: Number of data instances.
source

pub fn set_instance_data_from_vertex_buffer( &self, handle: &VertexBuffer, start_vertex: u32, num: u32 )

  • handle: Vertex buffer.
  • start_vertex: First instance data.
  • num: Number of data instances. Set instance data buffer for draw primitive. Dynamic vertex buffer.
source

pub fn set_instance_data_from_dynamic_vertex_buffer( &self, handle: &DynamicVertexBuffer, start_vertex: u32, num: u32 )

  • handle: Dynamic vertex buffer.
  • start_vertex: First instance data.
  • num: Number of data instances.
source

pub fn set_instance_count(&self, num_instances: u32)

  • num_instances:
source

pub fn set_texture( &self, stage: u8, sampler: &Uniform, handle: &Texture, flags: u32 )

  • stage: Texture unit.
  • sampler: Program sampler.
  • handle: Texture handle.
  • flags: Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture.
    • [SamplerFlags::[U/V/W]_[MIRROR/CLAMP]] - Mirror or clamp to edge wrap mode.
    • [SamplerFlags::[MIN/MAG/MIP]_[POINT/ANISOTROPIC]] - Point or anisotropic sampling.
source

pub fn touch(&self, id: ViewId)

  • id: View id.
source

pub fn submit(&self, id: ViewId, program: &Program, params: SubmitArgs)

  • id: View id.
  • program: Program.
  • depth: Depth for sorting.
  • flags: Discard or preserve states. See DiscardFlags.
source

pub fn submit_occlusion_query( &self, id: ViewId, program: &Program, occlusion_query: &OcclusionQuery, params: SubmitOcclusionQueryArgs )

  • id: View id.
  • program: Program.
  • occlusion_query: Occlusion query.
  • depth: Depth for sorting.
  • flags: Discard or preserve states. See DiscardFlags.
source

pub fn submit_indirect( &self, id: ViewId, program: &Program, indirect_handle: &IndirectBuffer, params: SubmitIndirectArgs )

  • id: View id.
  • program: Program.
  • indirect_handle: Indirect buffer.
  • start: First element in indirect buffer.
  • num: Number of draws.
  • depth: Depth for sorting.
  • flags: Discard or preserve states. See DiscardFlags.
source

pub fn submit_indirect_count( &self, id: ViewId, program: &Program, indirect_handle: &IndirectBuffer, start: u16, num_handle: &IndexBuffer, params: SubmitIndirectCountArgs )

  • id: View id.
  • program: Program.
  • indirect_handle: Indirect buffer.
  • start: First element in indirect buffer.
  • num_handle: Buffer for number of draws. Must be created with [BufferFlags::INDEX32] and BufferFlags::DRAW_INDIRECT.
  • num_index: Element in number buffer.
  • num_max: Max number of draws.
  • depth: Depth for sorting.
  • flags: Discard or preserve states. See DiscardFlags.
source

pub fn set_compute_index_buffer( &self, stage: u8, handle: &IndexBuffer, access: Access )

  • stage: Compute stage.
  • handle: Index buffer handle.
  • access: Buffer access. See Access.
source

pub fn set_compute_vertex_buffer( &self, stage: u8, handle: &VertexBuffer, access: Access )

  • stage: Compute stage.
  • handle: Vertex buffer handle.
  • access: Buffer access. See Access.
source

pub fn set_compute_dynamic_index_buffer( &self, stage: u8, handle: &DynamicIndexBuffer, access: Access )

  • stage: Compute stage.
  • handle: Dynamic index buffer handle.
  • access: Buffer access. See Access.
source

pub fn set_compute_dynamic_vertex_buffer( &self, stage: u8, handle: &DynamicVertexBuffer, access: Access )

  • stage: Compute stage.
  • handle: Dynamic vertex buffer handle.
  • access: Buffer access. See Access.
source

pub fn set_compute_indirect_buffer( &self, stage: u8, handle: &IndirectBuffer, access: Access )

  • stage: Compute stage.
  • handle: Indirect buffer handle.
  • access: Buffer access. See Access.
source

pub fn set_image( &self, stage: u8, handle: &Texture, mip: u8, access: Access, format: TextureFormat )

  • stage: Compute stage.
  • handle: Texture handle.
  • mip: Mip level.
  • access: Image access. See Access.
  • format: Texture format. See: TextureFormat.
source

pub fn dispatch(&self, id: ViewId, program: &Program, params: DispatchArgs)

  • id: View id.
  • program: Compute program.
  • num_x: Number of groups X.
  • num_y: Number of groups Y.
  • num_z: Number of groups Z.
  • flags: Discard or preserve states. See DiscardFlags.
source

pub fn dispatch_indirect( &self, id: ViewId, program: &Program, indirect_handle: &IndirectBuffer, params: DispatchIndirectArgs )

  • id: View id.
  • program: Compute program.
  • indirect_handle: Indirect buffer.
  • start: First element in indirect buffer.
  • num: Number of dispatches.
  • flags: Discard or preserve states. See DiscardFlags.
source

pub fn discard(&self, flags: u8)

source

pub fn blit( &self, id: ViewId, dst: &Texture, dst_mip: u8, dst_x: u16, dst_y: u16, dst_z: u16, src: &Texture, params: BlitArgs )

  • id: View id.
  • dst: Destination texture handle.
  • dst_mip: Destination texture mip level.
  • dst_x: Destination texture X position.
  • dst_y: Destination texture Y position.
  • dst_z: If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.
  • src: Source texture handle.
  • src_mip: Source texture mip level.
  • src_x: Source texture X position.
  • src_y: Source texture Y position.
  • src_z: If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.
  • width: Width of region.
  • height: Height of region.
  • depth: If texture is 3D this argument represents depth of region, otherwise it’s unused.
source§

impl Encoder

source

pub fn set_uniform(&self, handle: &Uniform, value: &[f32], num: u16)

  • handle: Uniform.
  • value: Pointer to uniform data.
  • num: Number of elements. Passing u16::MAX will use the _num passed on uniform creation.

Auto Trait Implementations§

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>,

§

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>,

§

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.