Conversation
Firestar99
left a comment
There was a problem hiding this comment.
Rebased it on main, squashed the fmt fixes and added disassembly and arrays from consts to the compiletest.
Overall, I'm super impressed how simple this has turned out to be. I haven't looked at our existing pointer emulation too deeply before, but this seems quite logical.
@LegNeato But this also shows that I've been wrong about RuntimeArray only being used via spirv_std::RuntimeArray, it is also used to represent slices. Just that those slices get removed in the post-link legalization, since they contain a pointer, so you don't actually see them in the disassembly of the compiletest.
See:
rust-gpu/crates/rustc_codegen_spirv/src/abi.rs
Lines 637 to 646 in bdf8bae
|
@Firestar99 we should probably use |
fixes casting array as a slice , or array to ptr :
*[T; N] -> *[T]
*[T; N] -> *T
fixes #465