-
Notifications
You must be signed in to change notification settings - Fork 61
[eddyb's version/leftovers] TypedBuffer
/ #[spirv(typed_buffer)]
.
#319
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
Conversation
… `SpirvType::InterfaceBlock`s.
ed8c356
to
8695a3a
Compare
8695a3a
to
1188451
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea what this change actually fixes. The tests you provided do compile on master without issues. Have you cherry-picked these from edition 2024 branch? Could be that a breaking change was introduced there, that requires these changes.
>, | ||
) { | ||
let mut load_dta = unsafe { my_data.index(global_invocation_id.x as usize) }.some_big_data[0]; | ||
load_dta = 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we loading data into load_dta: u32
to then immediately replace the value with a const? Could DCE screw us over here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I wonder if this was meant to be &mut
followed by *... = 32;
.
Funnily enough, the bug this test catches (post-rust-lang/rust#134117) happens much earlier, so only MIR optimizations could invalidate that part, even in theory (though ideally we'd not rely on incidental stuff like this, and add separate tests).
Anyway, for reading values I tend to just add an output variable to write them to, guaranteeing the read will be kept around, I might make that change if it's not obvious what the original tests meant to do.
There's two things going on here (basically the two commits are separate):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just gonna approve it as is, if the test in their current weird shape help us debug future code breakage.
I wasn't sure if you already disabled merge queue squashing or not |
This is one of a few branches that (due to my own neglect) got landed in a partial/broken state, this one in:
So what's left here is:
MaybeUninit<&[T]>
, which I kept losing track of as a separate thing until just now!I believe what happened is #16, in order to get things working, tried passing
&mut result_slot
toasm!
, and that happened to work, and I only figured out why recently (MaybeUninit<&[T]>
and&[T]
are both scalar pairs, so they each have the same fields, even if they're a differentOpTypeStruct
SPIR-V types before this PR).Also, there are some incidental aspects of the tests added here (namely,
.array_field[0]
that needs to do an effective offset of0
bytes), which catches #233 (comment).