wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Add parsing support for un/pack4xI/U8

Open VlaDexa opened this issue 1 year ago • 6 comments

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 test to run tests.
  • [x] Add change to CHANGELOG.md. See simple instructions inside file.

VlaDexa avatar Mar 22 '24 09:03 VlaDexa

I have no idea how to use those magic words that make the spir-v backend, so I really would appreciate some help here

VlaDexa avatar Mar 22 '24 21:03 VlaDexa

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 avatar Mar 28 '24 16:03 teoxoy

@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?

VlaDexa avatar Apr 08 '24 21:04 VlaDexa

It's on my radar, there have been other PRs that need/needed attention as well. I should get to it these coming days.

teoxoy avatar Apr 09 '24 14:04 teoxoy

I squashed all the commits, rebased and extracted the match refactor to make it easier to review.

teoxoy avatar Apr 15 '24 20:04 teoxoy

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.

teoxoy avatar Apr 19 '24 10:04 teoxoy

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.

teoxoy avatar May 14 '24 10:05 teoxoy

Done

VlaDexa avatar May 14 '24 15:05 VlaDexa