Rust-GPU / Rust-GPU/rust-gpu

[Migrated] Allow keeping linkage annotation

Open
#88 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.4k
Forks
125
PR merge metrics
No merged PRs in 30d

Description

Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/1042
Old labels: t: enhancement
Originally creatd by SiebenCorgie on 2023-04-21T16:42:49Z


SpirV allows defining import and export [0] for linking separate Shader modules [1] post compilation.

Apparently SpirV linking is already used within rust-gpu, but not exposed. Therefore we can't use extern "C" as we usually would.

This functionality would be useful, for instance when building shader permutation systems.

The enhancement would basically be allowing extern C, #[no_mangle] etc. to map to (possibly named) import/export decorated values whenever the Linkage capability on spirv-builder is enabled.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the spirv-builder Linkage capability and review the linked SPIR-V linkage specification. Trace how rust-gpu currently handles extern "C" and #[no_mangle" values, then determine the required mapping to named import/export decorations. Done means linkage annotations are preserved when Linkage is enabled and separate shader modules can use them.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.