Skip to content

Thoughts on maintaining the SpirvBuilder interface #19

@tombh

Description

@tombh

I've been trying to get a rust-gpu shader crate compiled with cargo gpu, but the shader still relies on an oldish rust-gpu that uses the nightly-2023-09-30 toolchain. I've tried compiling with a newer version of rust-gpu (namely the current default in cargo-gpu) but the shader seems to generate a new compile error. I'll submit an issue about that later on rust-gpu itself.

I was hopeful that cargo gpu's --spirv-builder and --rust-toolchain arguments would help here, but of course I soon ran into the fact that older versions of spirv-builder don't have the same method interfaces. For example, SpirvBuilder::new().rustc_codegen_spirv_location() didn't exist. And so even though cargo gpu did everything else right, checking out the old rust-gpu version, installing the old toolcahin (that is so awesome BTW!), it couldn't actually do the shader compilation simply because SpirvBuilder had changed.

I suspect this might be something we could run into more in the future. Sure we can just freeze the interface, but that's not realistically sustainable in the long run. So what other options are there? One I can think of is putting spirv-builder into its own repo, or maybe even this repo? That way spirv-builder and rust-gpu can be downloaded separately. But then maybe that just moves the same problem to the spirv-builder-rust-gpu interface?

PS: I wonder if a better name for --spirv-builder could be --spirv-builder-source or --spirv-builder-version?

Metadata

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