-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add mesh shading info to naga IR #8104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Add mesh shading info to naga IR #8104
Conversation
I'm unsure why the MSRV minimal versions thing is failing, it doesn't look related to this PR since it happens in another crate and this PR doesn't touch anything cargo. |
Should be fixed with #8112, thanks @andyleiserson! |
@@ -966,6 +984,7 @@ pub enum Binding { | |||
/// Optional `blend_src` index used for dual source blending. | |||
/// See <https://www.w3.org/TR/WGSL/#attribute-blend_src> | |||
blend_src: Option<u32>, | |||
per_primitive: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have some docs for this? The Location
variant's docs talk about passing values from the vertex stage to the fragment stage; we should make sure the story told here makes sense for readers working on mesh shaders too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to write some docs. Let me know if you have further comments.
Going to ping you again @jimblandy just to make sure that this doesn't get forgotten about until the next meeting :) |
@SupaMaggie70Incorporated I'll try to get to this tonight, but it may be Saturday. |
@SupaMaggie70Incorporated Are these comments at the top of
|
I've updated the top of |
(This is not a review comment on this PR, and not directed at SupaMaggie, just commenting on the pre-existing state of the docs.)
This is just not adequate. If we're going to add syntax to Naga that is not covered by the WGSL specification, we need to document that syntax. Knowing how mesh shading works in Vulkan does not magically explain the syntax for mesh shaders in WGSL, or how to invoke them in wgpu. |
It wouldn't be part of this PR, but if you think that having a writeup somewhere to describe mesh shaders would be useful, I'm happy to do that separately. However, I have never written a comprehensive GPU API spec before, so I don't exactly think it would be of comparable quality to e.g. the webgpu spec :) Also, that specific disclaimer was copy-pasted directly from the RT spec. |
Well, the alternative is just saying "read the code and the examples and figure it out". You want people to actually use your work, right? I just pushed some docs; do they look correct? |
More later - sorry to take so long. |
I'd like to make a few edits, at least around the section about task shader returns, just to clarify some things. Overall I think this is a step in the right direction. I'll try to get to this tonight or tomorrow |
We don't need to have everything fully documented before we land. I just end up writing docs (or trying to) in the process of figuring out what's going on in a PR. |
Fair. |
Sounds great. Just go ahead and push your changes to the branch, and I'll check them out. I'm curious to see what changes, but I'm not possessive about the text. |
@jimblandy You mention invocations a lot in your docs, is this a mistake or is this how wgpu docs are commonly written? Task and mesh shaders all function in units of workgroups (like compute shaders) and all outputs are shared across the workgroups. The workgroup size is also constant and part of the shader. The group size arguments you pass to |
I'm going to work on the spec a little more to try to clarify what mesh shaders are, not just how the new API works. |
My mistake.
Mistake. This one I should have known - thanks for catching it. |
Connections
Mostly split off from #7930
Works towards #7197
Description
This PR adds mesh shading info to naga IR so that parsers and writers have an interface to use.
Testing
No testing yet (coming in later PRs, the code here has been tested in #7930)
Squash or Rebase?
Squash
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.