Skip to content

Instantly share code, notes, and snippets.

@MaikKlein
Last active June 17, 2018 17:11
Show Gist options
  • Save MaikKlein/9022e9c08993d1d0214f8791fe47db97 to your computer and use it in GitHub Desktop.
Save MaikKlein/9022e9c08993d1d0214f8791fe47db97 to your computer and use it in GitHub Desktop.
#[spirv(runtime_array_get)]
fn runtime_array_get<T, R>(data: T, index: usize) -> R {
panic!()
}
impl<T> RuntimeArray<T> {
pub fn get(&self, index: usize) -> T {
runtime_array_get(self, index)
}
}
// vs
// Doesn't work. tcx.get_attrs returns nothing.
impl<T> RuntimeArray<T> {
#[spirv(runtime_array_get)]
pub fn get(&self, index: usize) -> T {
panic!()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment