Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double decoration if a binding array contains a struct with a runtime array #5776

Merged
merged 5 commits into from
Jun 10, 2024

Conversation

Vecvec
Copy link
Contributor

@Vecvec Vecvec commented Jun 5, 2024

Connections
Fixes #5755

Description
Previously if a binding array contained a struct with a runtime array it would generate two OpDecorate Blocks which was not allowed by the spirv specification.

Testing
This shader no longer produces two OpDecorate Blocks

struct Array {
    arr: array<u32>,
}

@group(0) @binding(0)
var<storage> store: binding_array<Array>;

and a similar one inside naga's tests (binding-buffer-arrays.spvasm) also no longer produces two OpDecorate Blocks

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown not applicable
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Vecvec Vecvec requested a review from a team as a code owner June 5, 2024 09:54
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Thanks!

@teoxoy teoxoy merged commit 73401ed into gfx-rs:trunk Jun 10, 2024
25 checks passed
@Vecvec Vecvec deleted the fix-double-decoration branch June 15, 2024 18:36
@kvark
Copy link
Member

kvark commented Jul 9, 2024

@teoxoy are we planning to have this fix on crates soon?

@cwfitzgerald
Copy link
Member

This will land during the next wgpu release, 0.22, which is scheduled for next Wednesday.

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.

Binding array containing a struct with a runtime array causes invalid spirv
4 participants