-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Naga mesh shader SPIR-V writer #8456
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?
Naga mesh shader SPIR-V writer #8456
Conversation
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
|
@cwfitzgerald All comments should be addressed, ready for round 2! (=2) |
cwfitzgerald
left a comment
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.
Some more comments - also tests need to pass.
|
I'll work on fixing the tests... at some point |
|
For future me to enjoy and ponder: |
|
I also have some AMD GPU code from windows that I'll upload at some point but its absolutely unreadable to my eyes. |
|
For future reference: I have taken the generated code with debug symbols and put it through SPIRV-Opt, I have put it through SPIRV-Cross and then back through glslc, and both times it still caused a bug in LLVMPipe. Not sure about AMD however. I have also narrowed it down to just being the mesh shader part. |
|
Update: got this to work by modifying the body of main() in the generated GLSL. Therefore, the interface is fine, and its just an issue with something goofy. |
|
These comments are spammy if anyone is listening so you don't need to I have narrowed it down to this little bit of code that breaks stuff even if the values are immediately rewritten: Notably, it has to be referenced by I'm beginning to believe this really is a mesa bug |
|
The following when replacing the body of the generated GLSL makes it terminate with sigsegv: It doesn't terminate when |
This example is broken but only because of the first 3 lines in main: if you chain the indexing to use 0 it works fine, and if you remove it it works fine. |
|
If I change naga's logic to use when deciding which index to copy over, it actually passes all of the tests except for 2: So in conclusion I have no fucking clue what's going on. |
|
This shader Which is a copy-paste of the fully functional SPIR-V that works on NVIDIA, AMD, and LLVMPIPE, except for the fails to run on LLVMPIPE. LLVMPIPE segfaults here. |
Connections
Works towards #7197
Builds on #8370
Description
Add a SPIR-V writer for mesh shaders
All major changes here are in the SPIR-V backend for naga and naga snapshots. Other "changes" are inherited from #8370
Testing
Mesh shader test WGSL is now written to SPIR-V as a snapshot. Mesh shader tests & example use naga-written spirv on vulkan backend.
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.