SAMPLER_DECL_REGEX

Static SAMPLER_DECL_REGEX 

Source
pub(crate) static SAMPLER_DECL_REGEX: LazyLock<Regex>
Expand description

HLSL sampler foo; / texture foo; declarations at module scope. The codegen wrapper provides the actual texture/sampler bindings, so user declarations are redundant — and they confuse the WGSL parser when they land inside fs_main. Stripped out wholesale.

Also matches the comma-list form sampler a, b, c; that a number of presets ship as a stylistic shortcut. A simpler regex stopping at the first identifier would let the trailing comma list survive as orphan statements b; c; that trip the WGSL parser with expected assignment or increment/decrement; found 'sampler_fw_rand01'.