Bring immediate in line with webgpu spec - #9280
Conversation
|
We should probably use a |
There was a problem hiding this comment.
I don't think this should block landing this, but:
The way this determines immediate_slots_required is not per spec. You need to look at the entry point(s) the pipeline uses, and see which specific fields of the var<immediate> type those entry points and their callees actually touch.
Getting this right will require a new bitmask field in naga::valid::FunctionInfo that gets populated probably by FunctionInfo::process_expression and process_block, and then consulted by wgpu_core.
| fn required_limits() -> wgpu::Limits { | ||
| wgpu::Limits { | ||
| max_immediate_size: 16, | ||
| max_immediate_size: 12, |
There was a problem hiding this comment.
Does this PR fix #4682 (which IIRC is the reason for this)?
There was a problem hiding this comment.
Maybe! I don't know.
There was a problem hiding this comment.
CC @Lichtso & @LPGhatguy since you know how to repro this issue (I personally couldn't).
There was a problem hiding this comment.
It only happens on metal with the validation layer on.
cwfitzgerald
left a comment
There was a problem hiding this comment.
Thanks for this!
A few miscellaneous comments. I think unless you feel really strongly, we should do the move to naga's FunctionInfo first, as it will need to be done no matter what once we hook up the CTS, and means you won't need to churn on this code for the stuff that is going to be replaced anyway.
0bb654a to
a53d7ea
Compare
cwfitzgerald
left a comment
There was a problem hiding this comment.
Some small things, then g2g.
|
Rebased onto latest trunk due to merge conflicts, the only new changes are the last "feedback" comment |
|
Thanks for spelling the commit situation out it really helps! |
Connections
ticks boxes in #8556
Description
Brings immediate validation in line with webgpu spec. Bitmask of immediate slots required for a pipeline, tracks slot writing, removes auto-zeroing, and infers immediate_size for auto pipline layouts
Testing
Theres some tests on the slot bitmask algorithm and some validation tests for set_immediates behavior
Squash or Rebase?
squash
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.