resolve_tex2d_sampler

Function resolve_tex2d_sampler 

Source
pub(crate) fn resolve_tex2d_sampler(
    name: &str,
) -> (&'static str, &'static str, bool)
Expand description

Resolve an MD2 sampler name to the (texture_binding, sampler_binding, recognised) triple the WGSL wrapper actually exposes. recognised = true suppresses the /*was: …*/ debug comment for bindings we routed deliberately (vs. the fallback case).

  1. Noise pack texturessampler_noise_lq / _mq / _hq route onto the dedicated noise textures using sampler_pw (point+wrap), matching MD2’s high-frequency sampling intent.
  2. fw/fc/pw/pc variants of mainsampler_fw_main, _fc_main, _pw_main, _pc_main keep sampler_main_texture but switch the sampler to the matching filter × address mode.
  3. Anything else — falls back to (sampler_main_texture, sampler_main) so unknown / user-loaded sampler names still produce valid WGSL. The original name is kept in a trailing comment for debugging.