Add parsing support for un/pack4xI/U8
Connections
- Closes #5423
Description WGSL spec defined new builtin functions. This PR tries to implement them
Current writer impls:
- [x] SPIR-V
- [x] HLSL
- [x] GLSL
- [x] MSL
- [x] WGSL
Testing
I think I added the necessary tests to naga/tests/in/bits.wgsl.
Checklist
- [x] Run
cargo fmt. - [x] Run
cargo clippy. If applicable, add:- [ ]
--target wasm32-unknown-unknown - [ ]
--target wasm32-unknown-emscripten
- [ ]
- [x] Run
cargo xtask testto run tests. - [x] Add change to
CHANGELOG.md. See simple instructions inside file.
I have no idea how to use those magic words that make the spir-v backend, so I really would appreciate some help here
I would look at some of the existing polyfills. For ex.:
https://github.com/gfx-rs/wgpu/blob/c613fbbeedc4c171a4bba66e1f4fc62f110c9102/naga/src/back/spv/block.rs#L734
https://github.com/gfx-rs/wgpu/blob/c613fbbeedc4c171a4bba66e1f4fc62f110c9102/naga/src/back/spv/block.rs#L987
@teoxoy Hey, it's been a week since this pr has been finished. Do I need to signal someone that it's ready ready or just wait for it to be reviewed, squashed and merged?
It's on my radar, there have been other PRs that need/needed attention as well. I should get to it these coming days.
I squashed all the commits, rebased and extracted the match refactor to make it easier to review.
It would be great if you could put together some execution tests that make sure the polyfills work properly.
There are some existing ones at this path: https://github.com/gfx-rs/wgpu/tree/54740d5982fa5ae004eee95dd6c037356ce9ea17/tests/tests/shader.
Could you squash the last 3 commits so that we end up with the refactor + the implementation? We can then land this without squashing it.
Done