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

Mesh Shaders #3018

Open
inodentry opened this issue Sep 11, 2022 · 10 comments
Open

Mesh Shaders #3018

inodentry opened this issue Sep 11, 2022 · 10 comments
Labels
api: dx12 Issues with DX12 or DXGI api: metal Issues with Metal api: vulkan Issues with Vulkan area: api Issues related to API surface type: enhancement New feature or request

Comments

@inodentry
Copy link

Mesh Shaders are an exciting new kind of rendering pipeline for modern hardware, that directly combines compute and rasterization.

KHRONOS recently officially released an extension for Vulkan, which is now quickly gaining support in different drivers. DX12 has had them for a while now. Metal (to my knowledge) also has them. Therefore, it should now be available on at least all the desktop platforms (given compatible hardware) and iOS.

Would it be possible for wgpu to provide access to this functionality?

There is a WebGPU tracking issue for it: gpuweb/gpuweb#3015 , but looks like it is not a priority and unlikely to be added to the WebGPU standard soon.

Perhaps wgpu could support it as a "native-only" extension?

@expenses
Copy link
Contributor

Mesh shaders as a native-only extension should be simple enough to implement, at least for vulkan. I'd like to look into this but I don't have a huge amount of free time to do so (similar to #1040 (comment)).

For anyone else interested, https://github.com/nvpro-samples/gl_vk_meshlet_cadscene is a vulkan example that uses the new VK_EXT_mesh_shader extension.

@heavyrain266
Copy link
Contributor

Mesh shader extension in WGSL could be really helpful for maintaining e.g. PSSL support in naga and PS5 API in wgpu, current implementation avoids usage of wgsl and requires rewriting all shaders in PSSL which is rather annoying to maintain.

@zmarlon
Copy link

zmarlon commented Oct 11, 2022

Since there are now mesh shaders on DX12, Metal and Vulkan, it would at least be possible on all modern APIs. DX11, OpenGL ES and WebGPU would of course not work. Would there be any interest in seeing mesh shaders in WGPU? If so, I might try to implement it.

@cwfitzgerald
Copy link
Member

There definitely is interest! It's going to be a big project though, so do join us in the chat room to chat about the design before starting work.

@cwfitzgerald cwfitzgerald changed the title Mesh Shader support? Mesh Shaders Oct 15, 2022
@cwfitzgerald cwfitzgerald added type: enhancement New feature or request area: api Issues related to API surface api: dx12 Issues with DX12 or DXGI api: metal Issues with Metal api: vulkan Issues with Vulkan labels Oct 15, 2022
@JunkuiZhang
Copy link
Contributor

Any progress have been made? Its a very exciting feature and maybe the future of game engine dev.

@lylythechosenone
Copy link
Contributor

Indeed, I would like to know this too. Has work actually started yet, or is this still just an idea?

@cwfitzgerald

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Nov 19, 2023

No one has taken lead in it - it's a rather involved thing, needing both improvements to Naga and wgpu.

If someone was so motivated, we could walk through potential implementation plans.

@ZoopOTheGoop
Copy link

ZoopOTheGoop commented Jun 5, 2024

Tag me in, I'd need a bit of a push in the right direction, but I'm willing to do the legwork.

@JMS55
Copy link
Contributor

JMS55 commented Jun 8, 2024

I'm not a wgpu maintainer, and can't help implement it, but I'd be happy to help test it out if you do implement mesh shaders. It's a feature I've been very much wanting.

In terms of implementation you would need to:

  • Figure out the common denominator between metal/vulkan/dx12 for an API to implement
  • Figure out all the edge cases and things that could go wrong, and how you would add validation for it
  • Add mesh shader support to naga's WGSL frontend
  • Add mesh shader support to naga's spirv/hlsl/msl backends

I definitely encourage you to join the matrix channel linked in the wgpu readme and talk to the wgpu devs there if you want to implement mesh shaders.

@Bromles

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dx12 Issues with DX12 or DXGI api: metal Issues with Metal api: vulkan Issues with Vulkan area: api Issues related to API surface type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants