coerce_texture_uv_args

Function coerce_texture_uv_args 

Source
pub(crate) fn coerce_texture_uv_args(src: &str) -> String
Expand description

For every tex2D(sampler, expr) call where expr is inferred as a vec3 or vec4 (not vec2), wrap expr in parens and append .xy. HLSL silently truncates non-vec2 UV args; WGSL rejects them. The regex pipeline doesn’t reach into call args at this depth.

Also normalises GetPixel/GetBlur1..3 arg #0 (which lift to textureSample later) and pow argument vec-mismatches (cluster A).