hadronized / spectra

Rust demoscene engine (currently on hold)
122 stars 6 forks source link

Fix transitive modules (fucking diamond) #37

Closed hadronized closed 6 years ago

hadronized commented 6 years ago
  A
  ^
 / \
B   C
^   ^
 \ /
  D

If D imports both B and C, that both import A, we get a duplicated A in D and it’s a pretty bad situation. We need to fix this by maintaining a set of already imported items per-module.

hadronized commented 6 years ago

I had forgotten that I somehow have that information already stored, since each shader modules gives its dependencies (it’s a Vec though, we might invest time to put that in a HashSet instead?).

Anyway, it’s just about dedup–ing when sinking the module. It should be fixed quickly.

hadronized commented 6 years ago

I like to go in a 2-step process there: