From f5c80a6d75d5022b175d3562f0965598b6398bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 14 Feb 2020 05:42:19 +0100 Subject: [PATCH] Upgrade `Mesh2D` indices from `u16` to `u32` --- examples/bezier_tool/src/main.rs | 2 +- wgpu/src/triangle.rs | 4 ++-- wgpu/src/widget/canvas/frame.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/bezier_tool/src/main.rs b/examples/bezier_tool/src/main.rs index fbb6fa24..efdb3924 100644 --- a/examples/bezier_tool/src/main.rs +++ b/examples/bezier_tool/src/main.rs @@ -94,7 +94,7 @@ mod bezier { layout: Layout<'_>, cursor_position: Point, ) -> (Primitive, MouseCursor) { - let mut buffer: VertexBuffers = VertexBuffers::new(); + let mut buffer: VertexBuffers = VertexBuffers::new(); let mut path_builder = lyon::path::Path::builder(); let bounds = layout.bounds(); diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index 6f3adbe4..3cc1d3fb 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -91,7 +91,7 @@ impl Pipeline { write_mask: wgpu::ColorWrite::ALL, }], depth_stencil_state: None, - index_format: wgpu::IndexFormat::Uint16, + index_format: wgpu::IndexFormat::Uint32, vertex_buffers: &[wgpu::VertexBufferDescriptor { stride: mem::size_of::() as u64, step_mode: wgpu::InputStepMode::Vertex, @@ -233,5 +233,5 @@ pub struct Mesh2D { /// 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. - pub indices: Vec, + pub indices: Vec, } diff --git a/wgpu/src/widget/canvas/frame.rs b/wgpu/src/widget/canvas/frame.rs index 687f6c37..27d676d6 100644 --- a/wgpu/src/widget/canvas/frame.rs +++ b/wgpu/src/widget/canvas/frame.rs @@ -9,7 +9,7 @@ use crate::{ pub struct Frame { width: f32, height: f32, - buffers: lyon::tessellation::VertexBuffers, + buffers: lyon::tessellation::VertexBuffers, transforms: Transforms, }