USER_COMP_BINDINGS

Constant USER_COMP_BINDINGS 

Source
const USER_COMP_BINDINGS: &str = r#"
@group(0) @binding(1)
var sampler_main_texture: texture_2d<f32>;

@group(0) @binding(2)
var sampler_main: sampler;

// Blur pyramid. Bindings 3/4/5 are progressively softer Gaussian-
// blurred copies of the warp output, populated each frame by
// `BlurPipeline`. They share `sampler_main` as their sampler — both
// the comp pass and these blur textures want linear filtering.
@group(0) @binding(3)
var sampler_blur1_texture: texture_2d<f32>;

@group(0) @binding(4)
var sampler_blur2_texture: texture_2d<f32>;

@group(0) @binding(5)
var sampler_blur3_texture: texture_2d<f32>;

// Procedural noise pack. Five fixed-resolution textures generated at
// engine init from a deterministic seed. The translator routes
// `tex2D(sampler_noise_lq|mq|hq, …)` and `tex3D(sampler_noisevol_lq|hq, …)`
// onto these bindings; user shaders that reference unknown noise sampler
// names still fall back to `sampler_main`.
@group(0) @binding(6)
var sampler_noise_lq_texture: texture_2d<f32>;

@group(0) @binding(7)
var sampler_noise_mq_texture: texture_2d<f32>;

@group(0) @binding(8)
var sampler_noise_hq_texture: texture_2d<f32>;

@group(0) @binding(9)
var sampler_noisevol_lq_texture: texture_3d<f32>;

@group(0) @binding(10)
var sampler_noisevol_hq_texture: texture_3d<f32>;

// MD2 sampler variants: filter (filtered=f / point=p) × address (wrap=w /
// clamp=c). The translator rewrites `tex2D(sampler_fw_main, uv)` →
// `textureSample(sampler_main_texture, sampler_fw, uv)`, and similarly
// for `_fc_` / `_pw_` / `_pc_`. Authored presets pick the variant per
// sample site; the runtime always has all four available.
@group(0) @binding(11)
var sampler_fw: sampler;

@group(0) @binding(12)
var sampler_fc: sampler;

@group(0) @binding(13)
var sampler_pw: sampler;

@group(0) @binding(14)
var sampler_pc: sampler;

// ---- User texture pack ----
// Disk-loaded textures referenced by `sampler sampler_<NAME>;` declarations
// in the preset's HLSL. The translator routes `tex2D(sampler_<NAME>, uv)`
// onto one of these slots based on the per-preset
// `onedrop_hlsl::TextureBindingPlan`. Unfilled slots get a 1×1 white
// fallback at bind time so the WGSL parses and the comp pass draws cleanly
// even when the texture pool is empty.
@group(0) @binding(15)
var sampler_user_0_texture: texture_2d<f32>;

@group(0) @binding(16)
var sampler_user_1_texture: texture_2d<f32>;

@group(0) @binding(17)
var sampler_user_2_texture: texture_2d<f32>;

@group(0) @binding(18)
var sampler_user_3_texture: texture_2d<f32>;

@group(0) @binding(19)
var sampler_user_4_texture: texture_2d<f32>;

@group(0) @binding(20)
var sampler_user_5_texture: texture_2d<f32>;

@group(0) @binding(21)
var sampler_user_6_texture: texture_2d<f32>;

@group(0) @binding(22)
var sampler_user_7_texture: texture_2d<f32>;

// Previous-frame display for the echo blend. Bound by
// the comp pipeline at binding 23 (immediately after the user-texture
// slots). User shaders can sample this directly if they want to roll
// their own echo; the default pipeline applies the standard MD2 blend
// in `shaders/comp.wgsl`.
@group(0) @binding(23)
var sampler_prev_main_texture: texture_2d<f32>;
"#;