Skip to content

Update naga_oil to use update-deps branch and bump wgpu to v27#91

Closed
sytherax wants to merge 2 commits into
mainfrom
upgrade_naga
Closed

Update naga_oil to use update-deps branch and bump wgpu to v27#91
sytherax wants to merge 2 commits into
mainfrom
upgrade_naga

Conversation

@sytherax

Copy link
Copy Markdown
Collaborator

This PR updates the naga_oil dependency to use the `update-deps` branch from https://github.com/sytherax/naga_oil, which brings in naga v27. To maintain compatibility, wgpu and wgpu-types have been updated to v27 as well. Fixed breaking changes including adding support for ImageClass::External and updating PollType::Wait API usage.

All tests pass.

@gooroo-dev

gooroo-dev Bot commented Oct 20, 2025

Copy link
Copy Markdown

Please double check the following review of the pull request:

🐞Mistake 🤪Typo 🚨Security 🚀Performance 💪Best Practices 📖Readability ❓Others
0 0 0 0 0 1 0

Changes in the diff

  • 🛠️ Updated dependencies in Cargo.toml: bumped naga and wgpu from v26 to v27, and patched naga_oil to use a git branch.
  • 🛠️ Modified device.poll call in particle_compute_demo.rs to use new wgpu::PollType::Wait struct with fields.
  • 🛠️ Updated autogenerated shader_bindings.rs file comments to reflect new wgsl_bindgen version and source hash.
  • 🛠️ Extended generate_binding_type_for_type function in wgsl_bindgen to handle naga::ImageClass::External by generating wgpu::BindingType::ExternalTexture binding.
  • 📖 Fixed indentation in the quoted code block inside generate_binding_type_for_type for StorageTexture binding.

Identified Issues

ID Type Details Severity Confidence
1 📖Readability Indentation inconsistency in wgsl_bindgen/src/generate/bind_group/single_bind_group.rs lines 470-487, affecting code clarity. 🟡 Low 🟡 Low

Issue 1

Explanation

In wgsl_bindgen/src/generate/bind_group/single_bind_group.rs at lines 470-487, the quoted code block for wgpu::BindingType::StorageTexture has inconsistent indentation compared to the rest of the function, which reduces readability.

Suggested fix

Adjust the indentation of the quoted code block to align properly with the surrounding code:

naga::ImageClass::Storage { format, access } => {
    // TODO: Will the debug implementation always work with the macro?
    // Assume texture format variants are the same as storage formats.
    let format = syn::Ident::new(&format!("{format:?}"), Span::call_site());
    let storage_access = storage_access(*access);

    quote!(wgpu::BindingType::StorageTexture {
        access: #storage_access,
        format: wgpu::TextureFormat::#format,
        view_dimension: #view_dim,
    })
}

Explanation of fix

Proper indentation improves code readability and maintainability, making it easier for developers to understand the structure and flow.

Missing tests

No new functionality or behavior changes that require additional tests were introduced in this diff. The changes are mostly dependency bumps, minor API usage updates, and code generation adjustments. Existing tests should cover the updated code paths.

Summon me to re-review when updated! Yours, Gooroo.dev
React or reply to keep the conversation going!

@tomben13

tomben13 commented Jan 6, 2026

Copy link
Copy Markdown

naga_oil latest now supports wgpu 27

Removed patch for naga_oil dependency in Cargo.toml
@Swoorup

Swoorup commented Mar 29, 2026

Copy link
Copy Markdown
Owner

Resolved in #97

@Swoorup Swoorup closed this Mar 29, 2026
@sytherax
sytherax deleted the upgrade_naga branch March 30, 2026 16:32
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.

3 participants