Good advice, I def know it's the shader, but I've been able to narrow it down:
@group(0) @binding(0) var<storage, read_write> input_data: array<u32, INPUT_LENGTH>;
@group(0) @binding(1) var<storage, read_write> output_data: array<vec4<f32>, OUTPUT_LENGTH>;
@group(0) @binding(2) var<storage, read> triangles_table: array<array<i32, 16>, 256>;
@compute @workgroup_size(4, 4, 4)
fn main(
@builtin(global_invocation_id) index: vec3<u32>,
) {
let edges = triangles_table[0];
for (var i: u32 = 0; i <= 12 && edges[i] != -1; i += 3u) {
let edge = edges[i];
output_data[0] = vec4<f32>(0.);
}
}
This still does the same error, but removing the edges[1] != -1 makes it not crash:
@group(0) @binding(0) var<storage, read_write> input_data: array<u32, INPUT_LENGTH>;
@group(0) @binding(1) var<storage, read_write> output_data: array<vec4<f32>, OUTPUT_LENGTH>;
@group(0) @binding(2) var<storage, read> triangles_table: array<array<i32, 16>, 256>;
@compute @workgroup_size(4, 4, 4)
fn main(
@builtin(global_invocation_id) index: vec3<u32>,
) {
let edges = triangles_table[0];
for (var i: u32 = 0; i <= 12; i += 3u) {
let edge = edges[i];
output_data[0] = vec4<f32>(0.);
}
}
Doesn't make it any less weird though :(