Skip to content

GPUProgrammableStage.entryPoint should be optional #5145

@jimblandy

Description

@jimblandy

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions