diff --git a/src/io/cache.rs b/src/io/cache.rs index 5763b969..4b5a0123 100644 --- a/src/io/cache.rs +++ b/src/io/cache.rs @@ -64,7 +64,7 @@ impl Cache { let mut geometry: VertexBuffers = VertexBuffers::new(); - tile.tesselate_stroke(&mut geometry, 1); + tile.tesselate_stroke(&mut geometry); self.responses.push(TesselatedTile { id: current_id, coords, diff --git a/src/render/shader_ffi.rs b/src/render/shader_ffi.rs index ff0e3fad..743ecbaf 100644 --- a/src/render/shader_ffi.rs +++ b/src/render/shader_ffi.rs @@ -50,25 +50,17 @@ impl GlobalsUniform { pub struct GpuVertexUniform { pub position: Vec2f32, pub normal: Vec2f32, - pub tile_id: u32, - _pad1: i32, // _padX aligns it to 8 bytes = AlignOf(Vec2f32=vec2): - // https://gpuweb.github.io/gpuweb/wgsl/#alignment-and-size } impl GpuVertexUniform { - pub fn new(position: Vec2f32, normal: Vec2f32, tile_id: u32) -> Self { - Self { - position, - normal, - tile_id, - _pad1: Default::default(), - } + pub fn new(position: Vec2f32, normal: Vec2f32) -> Self { + Self { position, normal } } } impl Default for GpuVertexUniform { fn default() -> Self { - GpuVertexUniform::new([0.0, 0.0], [0.0, 0.0], 0) + GpuVertexUniform::new([0.0, 0.0], [0.0, 0.0]) } } diff --git a/src/render/shaders/mod.rs b/src/render/shaders/mod.rs index 03029814..b344187b 100644 --- a/src/render/shaders/mod.rs +++ b/src/render/shaders/mod.rs @@ -88,12 +88,6 @@ pub mod tile { format: wgpu::VertexFormat::Float32x2, shader_location: 1, }, - // tile_id - wgpu::VertexAttribute { - offset: 2 * wgpu::VertexFormat::Float32x2.size(), - format: wgpu::VertexFormat::Uint32, - shader_location: 2, - }, ], }, wgpu::VertexBufferLayout { diff --git a/src/render/shaders/tile.vertex.wgsl b/src/render/shaders/tile.vertex.wgsl index 92d7a570..b61b5981 100644 --- a/src/render/shaders/tile.vertex.wgsl +++ b/src/render/shaders/tile.vertex.wgsl @@ -19,7 +19,6 @@ struct VertexOutput { fn main( [[location(0)]] position: vec2, [[location(1)]] normal: vec2, - [[location(2)]] tile_id: u32, [[location(3)]] color: vec4, [[location(4)]] translate: vec3, [[builtin(instance_index)]] instance_idx: u32 // instance_index is used when we have multiple instances of the same "object"