spirv: sim: adjust so Step{E,H}Context
does not use ArrayHandle
the specific way to accomplish this is touchy. see <https://github.com/EmbarkStudios/rust-gpu/issues/312#issuecomment-738824131>: > So I'd say placing any of the spirv_std::storage_class types into an aggregate (including capturing it in a closure) is unsupported for now in our specific case, we can't return a tuple where one element is a `&` to a spirv Input, and another element is a `&mut` to a spirv Output. when we have a struct, it can enclose either ONLY inputs, or ONLY outputs -- not a mix. i'm not 100% on how the Serialized stuff works, since it appears to violate that. i guess that's exactly what this ArrayHandle stuff achieves though.
This commit is contained in:
@@ -211,6 +211,13 @@ impl<'a, T> Array3<'a, T> {
|
||||
self.data.get_handle(idx)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_ref(self, idx: Vec3u) -> &'a T {
|
||||
let idx = checked_index(idx, self.dim).unwrap();
|
||||
unsafe {
|
||||
self.data.index_ref(idx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: Copy + Default> Array3<'a, T> {
|
||||
|
Reference in New Issue
Block a user