EN-001 — resolve an instanced draw command's vertex slot 1 binding and return the instance range. For non-instanced draws (`info` is None) this is a no-op and returns `0..1`. For instanced draws with a missing/destroyed buffer slot we return an empty range so the caller skips the draw rather than crashing on a stale handle.
(
&'pass self,
pass: &mut wgpu::RenderPass<'pass>,
info: &Option<InstanceDrawInfo>,
)
| 1633 | /// so the caller skips the draw rather than crashing on a stale |
| 1634 | /// handle. |
| 1635 | fn bind_instance_buffer<'pass>( |
| 1636 | &'pass self, |
| 1637 | pass: &mut wgpu::RenderPass<'pass>, |
| 1638 | info: &Option<InstanceDrawInfo>, |
| 1639 | ) -> std::ops::Range<u32> { |
| 1640 | match info { |
| 1641 | None => 0..1, |
| 1642 | Some(inst) => { |
| 1643 | if inst.buffer_handle == 0 { return 0..1; } |
| 1644 | let slot_idx = inst.buffer_handle as usize - 1; |
| 1645 | match self.instance_buffers.get(slot_idx).and_then(|s| s.as_ref()) { |
| 1646 | Some(ib_slot) => { |
| 1647 | pass.set_vertex_buffer(1, ib_slot.buffer.slice(..)); |
| 1648 | 0..inst.count |
| 1649 | } |
| 1650 | None => 0..0, |
| 1651 | } |
| 1652 | } |
| 1653 | } |
| 1654 | } |
| 1655 | |
| 1656 | /// Phase 4b — rebuild the SceneInputs (group 4) bind group with |
| 1657 | /// the current frame's snapshot textures. Called by the Renderer |
no test coverage detected