wgpu/naga/tests/out/hlsl/wgsl-7995-unicode-idents.hlsl
Erich Gubler 90702156af fix(namer): escape, rather than strip, non-ASCII ident. characters
Escape non-ASCII identifier characters with `write!(…, "u{:04x}", …)`,
surrounding with `_` as appropriate. This solves (1) a debugging issue
where stripped characters would otherwise be invisible, and (2) failure
to re-validate that stripped identifiers didn't start with an ASCII
digit.

I've confirmed that this fixes [bug
1978197](https://bugzilla.mozilla.org/show_bug.cgi?id=1978197) on the
Firefox side.
2025-10-01 08:50:37 -04:00

16 lines
241 B
HLSL

ByteAddressBuffer asdf : register(t0);
float compute()
{
float _e1 = asfloat(asdf.Load(0));
float u03b8_2_ = (_e1 + 9001.0);
return u03b8_2_;
}
[numthreads(1, 1, 1)]
void main()
{
const float _e0 = compute();
return;
}