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

[wgsl] Offset decorations on Structs #561

@dj2

Description

@dj2

With WGSL currently the [[offset x]] decoration is required for SSBO and UBO structs. This makes it simpler for a WGSL compiler as we're told the offsets to use, but makes it harder for a user as you have to figure out the offsets to use.

There are, at least, four ways to specify the offsets in Vulkan. std140, std430, relaxed block layout and scalar block layout. In all cases they turn into SPIR-V with specific offsets provided.

The layout requirements depends on the of buffer in vulkan (modulo extensions which change it) so that uniforms at std140 and ssbos are std140 or std430 I believe.

Do we leave WGSL as is and require explicit offsets, or do we relax and allow a given layout to be specified?

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