mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Fixes #1745: Support out-of-order module scope declarations in WGSL Fixes #1044: Forbid local variable shadowing in WGSL Fixes #2076: [wgsl-in] no error for duplicated type definition Fixes #2071: Global item does not support 'const' Fixes #2105: [wgsl-in] Type aliases for a vecN<T> doesn't work when constructing vec from a single argument Fixes #1775: Referencing a function without a return type yields an unknown identifier error. Fixes #2089: Error span reported on the declaration of a variable instead of its use Fixes #1996: [wgsl-in] Confusing error: "expected unsigned/signed integer literal, found '1'" Separate parsing from lowering by generating an AST, which desugars as much as possible down to something like Naga IR. The AST is then used to resolve identifiers while lowering to Naga IR. Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com> Co-authored-by: Jim Blandy <jimb@red-bean.com>
27 lines
596 B
WebGPU Shading Language
27 lines
596 B
WebGPU Shading Language
@compute @workgroup_size(1)
|
|
fn main() {
|
|
var i2 = vec2<i32>(0);
|
|
var i3 = vec3<i32>(0);
|
|
var i4 = vec4<i32>(0);
|
|
|
|
var u2 = vec2<u32>(0u);
|
|
var u3 = vec3<u32>(0u);
|
|
var u4 = vec4<u32>(0u);
|
|
|
|
var f2 = vec2<f32>(0.0);
|
|
var f3 = vec3<f32>(0.0);
|
|
var f4 = vec4<f32>(0.0);
|
|
|
|
u2 = bitcast<vec2<u32>>(i2);
|
|
u3 = bitcast<vec3<u32>>(i3);
|
|
u4 = bitcast<vec4<u32>>(i4);
|
|
|
|
i2 = bitcast<vec2<i32>>(u2);
|
|
i3 = bitcast<vec3<i32>>(u3);
|
|
i4 = bitcast<vec4<i32>>(u4);
|
|
|
|
f2 = bitcast<vec2<f32>>(i2);
|
|
f3 = bitcast<vec3<f32>>(i3);
|
|
f4 = bitcast<vec4<f32>>(i4);
|
|
}
|