This compiles fine with rustc (I guess this bit is probably eliminated?).
Example & Steps To Reproduce
I was using const generic parameters to determine the length of some arrays. At some point, a base case ended up declaring a zero-length array, like so:
#![cfg_attr(target_arch = "spirv", no_std)]
use spirv_std::spirv;
fn example<const LENGTH: usize>() {
let mut array = [0; LENGTH];
for i in 0..array.len() {
array[i] += i;
}
}
#[spirv(compute(threads(1, 1, 1)))]
pub fn compute() {
example::<0>();
}
Resulting in:
error: GEP not implemented for type struct [usize; 0] { }
--> examples/shaders/compute-shader/src/lib.rs:7:9
|
7 | array[i] += i;
| ^^^^^^^^^^^^^
Original issue: https://github.com/EmbarkStudios/rust-gpu/issues/1075
Expected Behaviour
This compiles fine with rustc (I guess this bit is probably eliminated?).
Example & Steps To Reproduce
I was using const generic parameters to determine the length of some arrays. At some point, a base case ended up declaring a zero-length array, like so:
Resulting in:
System Info