pub fn translate_shader(hlsl: &str) -> Result<String>Expand description
Translate HLSL shader code to WGSL.
The pipeline is intentionally linear:
- strip the MD2
shader_body { ... }outer wrapper, - type-substitute (
float4 → vec4<f32>, …), - function-substitute (
lerp → mix,tex2D → textureSample, …), - rewrite typed local declarations into WGSL
var ident: T = …;form, - strip HLSL semantics (
: POSITION, …).