Skip to content

WGSL: Support the requires directive #6350

@ErichDonGubler

Description

@ErichDonGubler

Standard WGSL supports something called the requires global directive, which allows shaders to declare that certain extensions either need to be supported by the WebGPU host, or shader compilation should fail. It's used like this:

requires readonly_and_readwrite_storage_textures; // single extension
requires packed_4x8_integer_dot_product, unrestricted_pointer_parameters; // multiple extensions, comma-separated

WGSL standard link: https://www.w3.org/TR/WGSL/#requires-directive

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions