Struct truck_rendimpl::PolygonInstance
source · pub struct PolygonInstance { /* private fields */ }
Expand description
Instance of polygon
One can duplicate polygons with different postures and materials that have the same mesh data. To save memory, mesh data on the GPU can be used again.
The duplicated polygon by Clone::clone
has the same mesh data and descriptor
with original, however, its render id is different from the one of original.
Implementations§
source§impl PolygonInstance
impl PolygonInstance
sourcepub fn clone_instance(&self) -> PolygonInstance
pub fn clone_instance(&self) -> PolygonInstance
Clone the instance as another drawn element.
sourcepub const fn instance_state(&self) -> &PolygonState
pub const fn instance_state(&self) -> &PolygonState
Returns a reference to the instance descriptor.
sourcepub fn instance_state_mut(&mut self) -> &mut PolygonState
pub fn instance_state_mut(&mut self) -> &mut PolygonState
Returns the mutable reference to instance descriptor.
sourcepub fn swap_vertex(&mut self, other: &mut PolygonInstance)
pub fn swap_vertex(&mut self, other: &mut PolygonInstance)
swap vertex buffers and index buffers
Trait Implementations§
source§impl Debug for PolygonInstance
impl Debug for PolygonInstance
source§impl Rendered for PolygonInstance
impl Rendered for PolygonInstance
source§fn vertex_buffer(
&self,
_: &DeviceHandler
) -> (Arc<BufferHandler>, Option<Arc<BufferHandler>>)
fn vertex_buffer(
&self,
_: &DeviceHandler
) -> (Arc<BufferHandler>, Option<Arc<BufferHandler>>)
Creates the pair (vertex buffer, index buffer).
source§fn bind_group_layout(
&self,
device_handler: &DeviceHandler
) -> Arc<BindGroupLayout>
fn bind_group_layout(
&self,
device_handler: &DeviceHandler
) -> Arc<BindGroupLayout>
Creates the bind group layout.
source§fn bind_group(
&self,
device_handler: &DeviceHandler,
layout: &BindGroupLayout
) -> Arc<BindGroup>
fn bind_group(
&self,
device_handler: &DeviceHandler,
layout: &BindGroupLayout
) -> Arc<BindGroup>
Creates the bind group in
set = 1
.source§fn pipeline(
&self,
device_handler: &DeviceHandler,
layout: &PipelineLayout,
scene_desc: &SceneDescriptor
) -> Arc<RenderPipeline>
fn pipeline(
&self,
device_handler: &DeviceHandler,
layout: &PipelineLayout,
scene_desc: &SceneDescriptor
) -> Arc<RenderPipeline>
Creates the render pipeline.
source§impl ToInstance<PolygonInstance> for PolygonMesh
impl ToInstance<PolygonInstance> for PolygonMesh
§type State = PolygonState
type State = PolygonState
Configuration descriptor for instance.
source§fn to_instance(
&self,
handler: &DeviceHandler,
shaders: &PolygonShaders,
state: &PolygonState
) -> PolygonInstance
fn to_instance(
&self,
handler: &DeviceHandler,
shaders: &PolygonShaders,
state: &PolygonState
) -> PolygonInstance
Creates
Instance
from self
.source§impl ToInstance<PolygonInstance> for StructuredMesh
impl ToInstance<PolygonInstance> for StructuredMesh
§type State = PolygonState
type State = PolygonState
Configuration descriptor for instance.
source§fn to_instance(
&self,
handler: &DeviceHandler,
shaders: &PolygonShaders,
state: &PolygonState
) -> PolygonInstance
fn to_instance(
&self,
handler: &DeviceHandler,
shaders: &PolygonShaders,
state: &PolygonState
) -> PolygonInstance
Creates
Instance
from self
.