(&'a self, pass: &mut RenderPass<'a>, camera_bind_group: &'a BindGroup)
| 184 | } |
| 185 | |
| 186 | pub(crate) fn draw(&self, pass: &mut RenderPass<'_>, camera_bind_group: &BindGroup) { |
| 187 | if self.vertex_count == 0 { |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | if let (Some(pipeline), Some(vb)) = (&self.pipeline, &self.vertex_buffer) { |
| 192 | pass.set_pipeline(pipeline); |
| 193 | pass.set_bind_group(0, camera_bind_group, &[]); |
| 194 | pass.set_vertex_buffer(0, vb.slice(..)); |
| 195 | pass.draw(0..self.vertex_count, 0..1); |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | impl Default for Grid { |