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

wgsl: type constructor expressions should have same execution rules as function calls #3813

@dneto0

Description

@dneto0

Example:

struct S { i : i32 };
fn f() {
   S();  // @ben-clayton asked: is this valid, by spec?
}

That would match func_call_statement which breaks down to a callable followed by an argument list. And a callable is an ident or a type-specifier-without-ident.
So syntactically it parses.

We use type checking to match to the type-constructor expression, which then gives the semantics.

However, the spec needs to make clear that type constructor expressions execute as if they are function calls. This is how we fit it into behaviour analysis and uniformity analysis. Behaviour analysis tables are given as pattern matches, so that probably already is covered. But we'd need the clarification to ensure type constructors are covered by the uniformity analysis for function calls.
https://gpuweb.github.io/gpuweb/wgsl/#uniformity-function-calls

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions