gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
11.46k stars 855 forks source link

Remove more internal uses of IDs #3 #5883

Closed teoxoy closed 2 days ago

teoxoy commented 3 days ago

The reason I extracted the code from passes was because PassErrorScope is Copy and I wanted to replace all the resources referenced by ids in its variants with ResourceErrorIdents which is not Copy. After going through all the work to do that, I realized I could remove the ids from all variants anyway because the inner error types already contained ResourceErrorIdent's where relevant; or if they didn't I added them. I think we should still land the code extractions since we can now deduplicate some of the code; it also removes the need to keep calling .map_pass_err() everywhere.

Part of https://github.com/gfx-rs/wgpu/issues/5121.

PR doesn't need to be squashed, each commit builds by itself.

Wumpf commented 3 days ago

Hmm even more conflicts with #5884, still haven't recovered from the last. Well, I guess I'll have to suck it up; that pr is still incomplete as there's a bunch of tests missing.

Edit: while I don't have time for a full review right now, skimming this some more it doesn't look all that bad since the core areas touched are different - good the the command arcanization thing went in before! I love the work you're doing here, more than willing to redo my draft on top!

teoxoy commented 3 days ago

Sorry for the conflicts, I can help rebase, just let me know.