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

GPUProgrammableStage.entryPoint should be optional #5145

Closed
jimblandy opened this issue Jan 26, 2024 · 3 comments · Fixed by #5148 or #5306
Closed

GPUProgrammableStage.entryPoint should be optional #5145

jimblandy opened this issue Jan 26, 2024 · 3 comments · Fixed by #5148 or #5306
Assignees

Comments

@jimblandy
Copy link
Member

In gpuweb/gpuweb#4387, the WebGPU API spec was changed such that, if there's only one appropriate entry point in the shader module, pipeline creation will just use that one automatically: you can omit its name from the GPUProgrammableStage when you create the pipeline.

This is a cute readability hack for small (and maybe not-so-small) examples, so folks are excited about using it in the WebGPU examples repo: webgpu/webgpu-samples#334

In our code, this would mean that wgpu_core::pipeline::ProgrammableStageDescriptor::entry_point would become an Option, consumers would use reflection to find the right entry point, and then callers in wgpu/Firefox/etc. would be changed to accommodate.

Since wgpu_core takes care of producing a naga::Module, it has enough information to choose an entry point before passing the module to wgpu_hal, so wgpu_hal can continue to require a specific name.

@jimblandy
Copy link
Member Author

I'm taking the liberty of marking this P1 for Firefox, because of webgpu/webgpu-samples#334.

@ErichDonGubler
Copy link
Member

I'll take this!

@ErichDonGubler
Copy link
Member

Firefox bug: bug 1877488

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants