wgpu/naga/tests/out/hlsl/phony_assignment.hlsl
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

17 lines
290 B
HLSL

cbuffer binding : register(b0) { float binding; }
int five()
{
return 5;
}
[numthreads(1, 1, 1)]
void main(uint3 id : SV_DispatchThreadID)
{
float phony = binding;
float phony_1 = binding;
const int _e6 = five();
const int _e7 = five();
float phony_2 = binding;
}