From 636bef9cd54e5cb4a7bbc219433a3a77ea92dae8 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 6 Aug 2023 11:40:02 -0700 Subject: [PATCH] Tracker mod docs: fix explanation of index re-use. --- wgpu-core/src/track/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wgpu-core/src/track/mod.rs b/wgpu-core/src/track/mod.rs index 111b4e961..69e29fc59 100644 --- a/wgpu-core/src/track/mod.rs +++ b/wgpu-core/src/track/mod.rs @@ -16,8 +16,10 @@ is a corresponding debug assert the checks if that access is valid. This helps get bugs caught fast, while still letting users not need to pay for the bounds checks. -In wgpu, resource IDs are allocated and re-used, so will always be as low -as reasonably possible. This allows us to use the ID as an index into an array. +In wgpu, each resource ID includes a bitfield holding an index. +Indices are allocated and re-used, so they will always be as low as +reasonably possible. This allows us to use IDs to index into an array +of tracking information. ## Statefulness