Skip to content

Add naga-types crate#9434

Open
inner-daemons wants to merge 19 commits intogfx-rs:trunkfrom
inner-daemons:naga-types
Open

Add naga-types crate#9434
inner-daemons wants to merge 19 commits intogfx-rs:trunkfrom
inner-daemons:naga-types

Conversation

@inner-daemons
Copy link
Copy Markdown
Collaborator

@inner-daemons inner-daemons commented Apr 15, 2026

Connections
Part of #8842
Sorta replaces part of #9080

Description
Add a naga-types crate so that naga can be made into an optional dependency.

Testing
Existing testing

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 inner-daemons marked this pull request as draft April 15, 2026 20:58
@inner-daemons inner-daemons marked this pull request as ready for review April 15, 2026 22:40
Comment thread wgpu-hal/src/gles/device.rs
Copy link
Copy Markdown
Collaborator

@atlv24 atlv24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, thanks for breaking it up into a bunch of reviewable commits!

Why the glsl::Version -> GlslVersion rename? (Also that could have been a separate commit from the move)

@inner-daemons
Copy link
Copy Markdown
Collaborator Author

@atlv24 I just figured it would be more clear and easy to understand, also since I added ApiVersion.

Comment thread naga-types/Cargo.toml Outdated
Comment thread naga-types/Cargo.toml Outdated
Comment thread naga/src/lib.rs

extern crate alloc;

extern crate naga_types as nt;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we previously talked about reducing these kind of aliases. But I don't exactly remember if that was the outcome.

cc @cwfitzgerald @jimblandy

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the issue: #6975

We were planning to rename wgpu-types to types but now with naga-types that seems problematic.

Comment thread naga/src/back/msl/writer.rs Outdated
Comment thread naga-types/src/lib.rs Outdated
Comment thread naga-types/src/glsl.rs Outdated
Comment thread naga-types/src/glsl.rs Outdated
Comment thread naga-types/src/glsl.rs
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
pub enum GlslScalarKind {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the GLSL prefix, these are already in the GLSL module.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to differentiate them from the types with the exact same name in naga, especially since this is intended to be primarily a naga subcrate

Comment thread wgpu-types/src/vertex.rs
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
pub struct VertexAttribute {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we moving VertexAttribute?

Comment thread wgpu-types/src/vertex.rs
#[derive(Copy, Clone, Debug, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))]
pub enum VertexStepMode {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we moving VertexStepMode?

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.

4 participants