mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 23:04:07 +00:00
4e9a2a5003
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
11 lines
294 B
WebGPU Shading Language
11 lines
294 B
WebGPU Shading Language
// Sourced from https://www.w3.org/TR/WGSL/#const-assert-statement
|
|
const x = 1;
|
|
const y = 2;
|
|
const_assert x < y; // valid at module-scope.
|
|
const_assert(y != 0); // parentheses are optional.
|
|
|
|
fn foo() {
|
|
const z = x + y - 2;
|
|
const_assert z > 0; // valid in functions.
|
|
const_assert(z > 0);
|
|
} |