From bb21805278f2e9934e8e26b1285d21f951c640db Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sat, 1 Jun 2024 22:55:50 -0400 Subject: [PATCH] render: add a debug_assert to ensure the developer doesn't reuse ids for slots --- lyra-game/src/render/graph/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lyra-game/src/render/graph/mod.rs b/lyra-game/src/render/graph/mod.rs index ba50510..21fe746 100644 --- a/lyra-game/src/render/graph/mod.rs +++ b/lyra-game/src/render/graph/mod.rs @@ -132,6 +132,11 @@ impl RenderGraph { // if there is a slot of the same name slot.id = *id; } else { + debug_assert!(!self.slots.contains_key(&slot.id), + "Reuse of id detected in render graph! Pass: {}, slot: {}", + desc.name, slot.name, + ); + let res_slot = ResourcedSlot { name: slot.name.clone(), ty: slot.ty,