Skip to content

[wgsl] Redundant [[layout]] decorations in addition to [[offset]] decorations #621

@kainino0x

Description

@kainino0x

In #561 it was agreed that we would keep the [[offset]] decorations in (pending user feedback).

Without [[layout]], the set of valid manual-layouts for a struct is the union of the layout rules allowed in that place, i.e.:

  • Check if it works with std430, if yes 👍
  • Check if it works with std140, if yes 👍
  • Otherwise 👎

(Note it's not certain whether std430 will be allowed for uniform blocks. Some Vulkan devices can't support it.)

AFAIU: Explicit [[layout]] would essentially allow authors to choose among the available layouts (which right now is only 1 or 2 layouts, possibly depending on context).

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