mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 00:11:11 +01:00
Without the suffix, `Expression::Literal(Literal::I32)` expressions get written without any suffix on the decimal number, meaning that they get re-parsed as AbstractInt values. In theory, this should always be fine, but since we don't actually support abstract types yet in all the places we should, having them appear in the output causes validation problems.
29 lines
489 B
WebGPU Shading Language
29 lines
489 B
WebGPU Shading Language
struct DynamicArray {
|
|
arr: array<u32>,
|
|
}
|
|
|
|
@group(0) @binding(0)
|
|
var<storage, read_write> dynamic_array: DynamicArray;
|
|
|
|
fn f() {
|
|
var v: vec2<i32>;
|
|
|
|
let px = (&v.x);
|
|
(*px) = 10i;
|
|
return;
|
|
}
|
|
|
|
fn index_unsized(i: i32, v_1: u32) {
|
|
let val = dynamic_array.arr[i];
|
|
dynamic_array.arr[i] = (val + v_1);
|
|
return;
|
|
}
|
|
|
|
fn index_dynamic_array(i_1: i32, v_2: u32) {
|
|
let p = (&dynamic_array.arr);
|
|
let val_1 = (*p)[i_1];
|
|
(*p)[i_1] = (val_1 + v_2);
|
|
return;
|
|
}
|
|
|