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

buffer size mismatch: more detail in error message #5858

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

nolanderc
Copy link
Contributor

Connections
N/A

Description
In case there is a buffer size mismatch between the shader and bindings, prints both sizes in the error message.

Testing
N/A

Checklist

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

@nolanderc nolanderc requested a review from a team as a code owner June 22, 2024 15:57
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

good addition, thanks!

Comment on lines +150 to +154
#[error("Buffer structure size {shader}, added to one element of an unbound array, if it's the last field, ended up greater than the given `min_binding_size`, which is {binding}")]
WrongBufferSize {
binding: wgt::BufferSize,
shader: wgt::BufferSize,
},
Copy link
Member

@Wumpf Wumpf Jun 23, 2024

Choose a reason for hiding this comment

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

those field names don't make sense to me. Both are sizes and not binding indices as the would names imply

Suggested change
#[error("Buffer structure size {shader}, added to one element of an unbound array, if it's the last field, ended up greater than the given `min_binding_size`, which is {binding}")]
WrongBufferSize {
binding: wgt::BufferSize,
shader: wgt::BufferSize,
},
#[error("Buffer structure size {structure_size}, added to one element of an unbound array, if it's the last field, ended up greater than the given `min_binding_size`, which is {min_binding_size}")]
WrongBufferSize {
structure_size: wgt::BufferSize,
min_binding_size: wgt::BufferSize,
},

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.

None yet

2 participants