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

Clarify wgpu's shader support in docs #2500

Closed
memoryruins opened this issue Feb 22, 2022 · 0 comments · Fixed by #2501
Closed

Clarify wgpu's shader support in docs #2500

memoryruins opened this issue Feb 22, 2022 · 0 comments · Fixed by #2501
Labels
type: enhancement New feature or request

Comments

@memoryruins
Copy link
Contributor

Is your feature request related to a problem? Please describe.

A common source of confusion I've seen is about wgpu's shader support and their target platform support, e.g. some believe GLSL/SPIR-V shader support will be removed, others believe SPIR-V/GLSL translation is only available on native but not web targets, etc. I might be carrying a set of misconceptions as well. Currently the Learn Wgpu tutorial states,

Note that, at the time of writing this, some WebGPU implementations also support SPIR-V, but it's just a temporary measure during the transition period to WGSL and will be removed

While this is can be true when describing WebGPU implementations in general, wgpu can continue to support more than what is in the WebGPU spec. As I understand it, WGSL, GLSL, and SPIR-V are all supported by wgpu, both on native and web targets, as naga can handle these translations as needed.

Additionally, wgpu::ShaderSource rustdocs could also benefit from mentioning which features need to be enabled. SPIR-V and GLSL require features = ["spirv", "glsl"] respectively. After linking that page, I noticed the type's docs were out of date on the current release, but that appears to have already been fixed by #2315 on master.

Describe the solution you'd like

Add a section in the readme (and rustdocs?) that describes shader support such as the targets targets each work on (native/web), features required, etc. After clarifying, I will open an issue on the Learn Wgpu tutorial to expand on wgpu's shader support specifically.

Additional context

Some cases of potential confusion I've seen in chats in the past month:

wgpu never "supported" glsl, it accepts wgsl and spir-v (on native, if you enable that extension).

My primary concern with sticking to glsl is that learn wgpu (It's a decent reference to remember details) claims that glsl is going to be removed from wgpu soon

im just happy im still on wgpu old enough to still just use GLSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants