Skip to content

Split shader compilation logic into new wgpu-shaders crate#9080

Draft
inner-daemons wants to merge 27 commits intogfx-rs:trunkfrom
inner-daemons:wgpu-shaders
Draft

Split shader compilation logic into new wgpu-shaders crate#9080
inner-daemons wants to merge 27 commits intogfx-rs:trunkfrom
inner-daemons:wgpu-shaders

Conversation

@inner-daemons
Copy link
Collaborator

@inner-daemons inner-daemons commented Feb 19, 2026

Connections
Closes #8842
Waiting for #9064

Description
Splits shader compilation into a wgpu-shaders crate so that naga can more easily be removed as a dependency, and the compilation logic can be reused for e.g. precompiling shaders.

Testing
Too early

Squash or Rebase?
Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@inner-daemons
Copy link
Collaborator Author

I'm gonna shout with excitement into the void here:

THE REFACTOR NOW WORKS FOR ALL BUT DX12 IN WGPU HAL!!!! ONLY TOOK LIKE 3K LINES

@inner-daemons
Copy link
Collaborator Author

Ok nvm, webassembly 1.0 is unhappy, but I'm counting it

@teoxoy
Copy link
Member

teoxoy commented Feb 25, 2026

To achieve the goal outlined in #8842 I don't see why there need to be any changes to the naga crate. Why is the new wgpu-shader-types crate needed? IIUC the new wgpu-shaders crate should contain the wgpu-hal-naga-glue code that's currently in wgpu-hal but that should be it.

@inner-daemons
Copy link
Collaborator Author

@teoxoy I think this has been answered but just to document that, wgpu-hal may need to use some types that naga uses without depending on naga. ShaderStage is the best example, they both use it, but if naga can be removed as a dependency then ShaderStage should live in a crate that can be depended on separately by both (wgpu-types can't be depended on by naga). It should probalby be renamed to naga-types however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split shader compilation into wgpu-shaders crate

2 participants