gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.12k stars 880 forks source link

FXC requires ASCII HLSL code #5814

Open teoxoy opened 2 months ago

teoxoy commented 2 months ago

pSourceName, pEntrypoint should also be ASCII.

See https://github.com/gfx-rs/wgpu/pull/5812#issuecomment-2167913609 for all the details.

This needs work in naga to remap all non-ASCII identifiers to ASCII.

workingjubilee commented 1 month ago

I guess we could basically punycode them? except _ instead of -, obviously.

teoxoy commented 1 month ago

That sounds like a good solution but we might not have to do this at all since we will probably drop support for FXC. @nical is working on adding the DXC dlls in Firefox.

jimblandy commented 1 month ago

It's just identifiers, right? It should be easy to make the namer take care of this, it already rejects some characters so it might be doing this already.

It would be smart to add an assertion to the HLSL backend that the output is in fact ASCII.

On my phone, but, we probably have a bug in that we don't adjust entry point names for the namer's changes?

teoxoy commented 1 month ago

On my phone, but, we probably have a bug in that we don't adjust entry point names for the namer's changes?

That's a good point, looking a the code, I don't think we do. Could you open a new issue for it?