Skip to content
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

Add support for the ext_mesh_shader extension #2433

Merged
merged 9 commits into from
Dec 28, 2023

Conversation

Rua
Copy link
Contributor

@Rua Rua commented Dec 26, 2023

Changelog:

### Breaking changes
Changes to pipelines:
- `GraphicsPipeline::input_assembly_state` returns an option now.

### Additions
- Support for the `ext_mesh_shader` extension.

This adds full mesh shader support for the EXT mesh shader extension. If we do want to support the NV version, that could be a little trickier, because it has its own draw_mesh_tasks* commands, which must be matched with the type of mesh and task shader. In other words, calling the EXT command requires EXT mesh shaders, and calling the NV command requires NV mesh shaders. Right now, the commands at least check to make sure you're using EXT mesh shaders. Other than the commands, NV mesh shaders are already handled properly so the commands are the only thing left, if we want to do it.

I haven't added an example that uses mesh shaders, as I don't really fully know how they're supposed to be used. This is something we definitely want. Perhaps a mesh-shaderfied version of the triangle example to demonstrate the differences, and then a more elaborate example using task shaders as well?

@Fuzzyzilla
Copy link
Contributor

Seems to work great! Got a Task (just dispatches 4 meshes) + Mesh that outputs a couple rectangles. Yippee!

It required digging into the pipeline validation logic to see that when using Mesh shaders, input state and assembly state must be None. I think the documentation saying those fields must always be Some needs updating :D

@Firestar99 Firestar99 mentioned this pull request Dec 28, 2023
5 tasks
@marc0246
Copy link
Contributor

Yay! 🎉

@marc0246 marc0246 merged commit 655ca5e into vulkano-rs:master Dec 28, 2023
3 checks passed
marc0246 added a commit that referenced this pull request Dec 28, 2023
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
* Add support for the `ext_mesh_shader` extension

* Helper function for queries

* Documentation update

* Add mesh primitives generated query

* Derp

* Support in vulkano-shaders too

* More doc fixes

* Better docs, explicitly saying when the values must be `Some` or `None`.

* Update vulkano/src/pipeline/graphics/mod.rs

Co-authored-by: marc0246 <[email protected]>

---------

Co-authored-by: marc0246 <[email protected]>
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
@Rua Rua deleted the mesh-shading branch February 3, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants