wgpu/naga/tests/in/phony_assignment.wgsl
Samson 866be693d6
[naga] Handle phony statements properly by treating them as named expressions (#6328)
* [naga wgsl-in] phony assignments add named expressions

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* [naga wgsl-out] write out _naga_phony as phony

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add test

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* use statement span

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* every phony has same name

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-27 14:52:53 -07:00

18 lines
326 B
WebGPU Shading Language

@group(0) @binding(0) var<uniform> binding: f32;
fn five() -> i32 {
return 5;
}
@compute @workgroup_size(1) fn main(
@builtin(global_invocation_id) id: vec3<u32>
) {
_ = binding;
_ = binding;
let a = 5;
_ = a;
_ = five();
let b = five();
// check for name collision
let phony = binding;
}