Skip to content

Cannot select MSL version with naga-cli #5389

Closed
@pcleavelin

Description

Forgive me if this should be a bug report (not sure it really qualifies).

I've been working on a project that originally used wgpu but have switched codebases/languages, however I still want to use the naga compiler. Since I'm on macOS (Apple Silicon) I'm compiling WGSL shader code to MSL using naga-cli v.0.19.0. Although, when using instancing (in particular @builtin(instance_index)) running naga shader.wgsl shader.metal outputs

attribute 'instance_id' is not supported for target MSL version

This looks to be because naga-cli uses the default version (which is MSL 1.0) when compiling, but naga-cli has no way to choose which metal version to use.

I've currently been using my own fork which adds support for this here. I can submit a PR for this, but I wasn't sure if there was a reason for leaving this feature out.

Also sorry if this is a duplicate issue, it can be hard to filter out issues only pertaining to the CLI.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions