这是indexloc提供的服务,不要输入任何密码
Skip to content

entry_point_decl should be an annotation on the function #662

@litherum

Description

@litherum

Today, this is how you describe an entry point in WGSL:

void foo() {
    ...
}
... perhaps hundreds of lines later ...
entry_point compute as MyComputeEntryPoint = foo

Just like how decorations are separate statements in SPIR-V, but were moved onto the variable declaration they are decorating in WGSL, the same treatment should be done on entry points. The benefit is that related concepts should be near each other in the source code.

Here's another way to do it:

[[expose_as = "MyComputeEntryPoint"]]
compute fn foo() -> void {
    ...
}

This wouldn't actually be less expressive, it would just keep related concepts together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions