scan_user_samplers

Function scan_user_samplers 

Source
pub fn scan_user_samplers(hlsl: &str) -> Vec<UserSamplerRef>
Expand description

Extract every sampler sampler_X; declaration from a MilkDrop comp shader HLSL and return the logical name (the part after sampler_) for each occurrence that isn’t already a built-in.

Built-ins skipped:

  • main (and its fw/fc/pw/pc_main variants)
  • noise_lq / noise_mq / noise_hq (and the same set prefixed by fw/fc/pw/pc_)
  • noisevol_lq / noisevol_hq (same prefix set)
  • blur1 / blur2 / blur3

The returned list preserves declaration order with duplicates removed. The renderer uses this to know which textures it needs to bind for this preset.

Format notesampler sampler_X and sampler2D sampler_X both match (MD2 uses both spellings; the type matters to HLSL but not to us since we strip the decl entirely before translation).