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

Make make_spirv_raw and make_spirv handle big-endian binaries #3411

Merged
merged 4 commits into from
Jan 21, 2023
Merged

Make make_spirv_raw and make_spirv handle big-endian binaries #3411

merged 4 commits into from
Jan 21, 2023

Conversation

1e1001
Copy link
Contributor

@1e1001 1e1001 commented Jan 20, 2023

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Fixes #3408.

Description
Swaps the words if that makes the first word match the magic. Also adds a check that the input isn't empty, not sure if it's needed but I think the better error message would be useful.

Testing
Locally tested by flipping a spir-v binary and comparing the result, if I need to add an actual test I will.

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Good minus a nit!

wgpu/src/util/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Tyvm!

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) January 21, 2023 03:52
@cwfitzgerald cwfitzgerald merged commit 5acb706 into gfx-rs:master Jan 21, 2023
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.

make_spirv_raw should handle big-endian SPIR-V binaries
2 participants