-
Notifications
You must be signed in to change notification settings - Fork 72
Erase explicit layout decorations (Offset
/ArrayStride
) when disallowed by Vulkan.
#379
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
base: main
Are you sure you want to change the base?
Erase explicit layout decorations (Offset
/ArrayStride
) when disallowed by Vulkan.
#379
Conversation
0fd77cb
to
707bdcc
Compare
53cf51d
to
8d01e85
Compare
8d01e85
to
84ed68f
Compare
I just want to note that you're upgrading CI's Vulkan SDK to 1.4.321.0, but |
@Firestar99 I 100% agree, that's why I still have the above quoted bit in the PR description, and it's why this PR was in draft state even before rebasing it on top of #400 (I know it'd be slower but it'd be nice to test EDIT: fixed the |
84ed68f
to
5a77372
Compare
As the I was able to get 10 failures in diff --git a/Cargo.toml b/Cargo.toml
index 7cf09984100..9da910407c9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -49,3 +49,3 @@ spirv-std-types = { path = "./crates/spirv-std/shared", version = "=0.9.0" }
spirv-std-macros = { path = "./crates/spirv-std/macros", version = "=0.9.0" }
-spirv-tools = { version = "0.12.1", default-features = false }
+spirv-tools = { version = "0.12.1", git = "https://github.com/Rust-GPU/spirv-tools-rs", default-features = false }
rustc_codegen_spirv = { path = "./crates/rustc_codegen_spirv", version = "=0.9.0", default-features = false }
diff --git a/crates/rustc_codegen_spirv/src/linker/mod.rs b/crates/rustc_codegen_spirv/src/linker/mod.rs
index d289c8e5fce..89c46e11f03 100644
--- a/crates/rustc_codegen_spirv/src/linker/mod.rs
+++ b/crates/rustc_codegen_spirv/src/linker/mod.rs
@@ -564,3 +564,3 @@ pub fn link(
- {
+ if false {
let timer = before_pass("spirt_passes::explicit_layout::erase_when_invalid"); Re-enabling the pass (removing So we should be able to land this once we release another version of |
Blocked on getting a
spirv-tools-rs
release for:More recent Vulkan SDK versions have started complaining about types having explicit memory layout, when used with memory that doesn't inherently require explicit layouts (only push constants and buffers really do), e.g.:
The solution used here is simpler and more specialized (a pass that erases the explicit layout decorations from types behind pointers in storage classes that don't support them, combined with updating affected loads/stores) than what I originally described in #266 (comment), so we can hopefully use this for now and not worry about
spirt::{mem,qptr}
for the next release.(not actually tested with MoltenVK, we should make sure it actually works now)