gfx-rs / wgpu

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

SPIR-V back-end uses extra pass to write output #4303

Open Timo-DK opened 4 years ago

Timo-DK commented 4 years ago

At the moment, the current SPIR-V back-end uses an exta pass, which results in increased and (probably) unnecessary memory.

After everything is parsed, it then rearranges all the data in the correct order for the Physical- and Logical Layout.

A better and proposed way of @kvark is just single passing it. This means stripping the phase of rearranging, and holding data in temporarily vectors, to just directly write it to the output string.

There will be some lightweight "scans" through the IR to look for example the Capabilities the SPIR-V output requires, but this shouldn't be a whole lot of iterations.

kvark commented 3 years ago

The capabilities concern is now totally resolved by gfx-rs/naga#315. The road to single-pass is now open.