mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-10 16:43:34 +00:00
When an initializer is present, use type inference instead of explicitly typing `var` and `let` declarations. This reduces the size of the generated WGSL and improves readability. Change-Id: I241ee2108279b550735945940f2b62bbbd493708 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132142 Commit-Queue: David Neto <dneto@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Auto-Submit: James Price <jrprice@google.com> Reviewed-by: David Neto <dneto@google.com>
18 lines
274 B
WebGPU Shading Language
18 lines
274 B
WebGPU Shading Language
fn func(value : i32, pointer : ptr<function, i32>) -> i32 {
|
|
let x_9 = *(pointer);
|
|
return (value + x_9);
|
|
}
|
|
|
|
fn main_1() {
|
|
var i = 0i;
|
|
i = 123i;
|
|
let x_19 = i;
|
|
let x_18 = func(x_19, &(i));
|
|
return;
|
|
}
|
|
|
|
@compute @workgroup_size(1i, 1i, 1i)
|
|
fn main() {
|
|
main_1();
|
|
}
|