mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-17 04:41:23 +00:00
When an OpConstantComposite result is used by multiple instructions, declare it as a module-scope `const` instead of inlining the constant at each use site. This fixes an issue whereby the spirv-reader was massively inflating the size of the WGSL it produces, which was caught via an OOM fuzzer bug. Bug: oss-fuzz:57795 Change-Id: Iac8c6a2147a7e2ebfddbaacae9fcb1dbe0b59e9d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128881 Auto-Submit: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Commit-Queue: David Neto <dneto@google.com>
14 lines
272 B
WebGPU Shading Language
14 lines
272 B
WebGPU Shading Language
const x_10 = vec3<f32>(1.0f, 2.0f, 3.0f);
|
|
|
|
fn main_1() {
|
|
let x_11 : f32 = x_10.y;
|
|
let x_13 : vec2<f32> = vec2<f32>(x_10.x, x_10.z);
|
|
let x_14 : vec3<f32> = vec3<f32>(x_10.x, x_10.z, x_10.y);
|
|
return;
|
|
}
|
|
|
|
@compute @workgroup_size(1i, 1i, 1i)
|
|
fn main() {
|
|
main_1();
|
|
}
|