Upgrade `Mesh2D` indices from `u16` to `u32`
This commit is contained in:
parent
945dfabd71
commit
f5c80a6d75
|
@ -94,7 +94,7 @@ mod bezier {
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
) -> (Primitive, MouseCursor) {
|
) -> (Primitive, MouseCursor) {
|
||||||
let mut buffer: VertexBuffers<Vertex2D, u16> = VertexBuffers::new();
|
let mut buffer: VertexBuffers<Vertex2D, u32> = VertexBuffers::new();
|
||||||
let mut path_builder = lyon::path::Path::builder();
|
let mut path_builder = lyon::path::Path::builder();
|
||||||
|
|
||||||
let bounds = layout.bounds();
|
let bounds = layout.bounds();
|
||||||
|
|
|
@ -91,7 +91,7 @@ impl Pipeline {
|
||||||
write_mask: wgpu::ColorWrite::ALL,
|
write_mask: wgpu::ColorWrite::ALL,
|
||||||
}],
|
}],
|
||||||
depth_stencil_state: None,
|
depth_stencil_state: None,
|
||||||
index_format: wgpu::IndexFormat::Uint16,
|
index_format: wgpu::IndexFormat::Uint32,
|
||||||
vertex_buffers: &[wgpu::VertexBufferDescriptor {
|
vertex_buffers: &[wgpu::VertexBufferDescriptor {
|
||||||
stride: mem::size_of::<Vertex2D>() as u64,
|
stride: mem::size_of::<Vertex2D>() as u64,
|
||||||
step_mode: wgpu::InputStepMode::Vertex,
|
step_mode: wgpu::InputStepMode::Vertex,
|
||||||
|
@ -233,5 +233,5 @@ pub struct Mesh2D {
|
||||||
/// The list of vertex indices that defines the triangles of the mesh.
|
/// The list of vertex indices that defines the triangles of the mesh.
|
||||||
///
|
///
|
||||||
/// Therefore, this list should always have a length that is a multiple of 3.
|
/// Therefore, this list should always have a length that is a multiple of 3.
|
||||||
pub indices: Vec<u16>,
|
pub indices: Vec<u32>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::{
|
||||||
pub struct Frame {
|
pub struct Frame {
|
||||||
width: f32,
|
width: f32,
|
||||||
height: f32,
|
height: f32,
|
||||||
buffers: lyon::tessellation::VertexBuffers<triangle::Vertex2D, u16>,
|
buffers: lyon::tessellation::VertexBuffers<triangle::Vertex2D, u32>,
|
||||||
|
|
||||||
transforms: Transforms,
|
transforms: Transforms,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue