replace_texture_sampling_with_plan

Function replace_texture_sampling_with_plan 

Source
pub(crate) fn replace_texture_sampling_with_plan(
    code: &str,
    plan: &TextureBindingPlan,
) -> String
Expand description

Rewrite tex2D(<sampler>, <uv>) to a WGSL textureSample call against the (texture, sampler) pair resolved from the MD2 sampler name. Paren-balanced because the uv expression often contains nested calls (tex2D(s, uv + offset(t))).