wrap_user_warp_shader_with_plan

Function wrap_user_warp_shader_with_plan 

Source
pub fn wrap_user_warp_shader_with_plan(
    translated_body: &str,
    plan: &TextureBindingPlan,
) -> String
Expand description

Wrap a translated WGSL fragment body for the warp pass into a complete shader module. Mirror of wrap_user_comp_shader_with_plan — same uniforms, same texture bindings, same MD2 private-state declarations — but with a vertex shader that consumes the warp-mesh WarpVertex (pos_clip + uv_warp) and a fragment that seeds uv from uv_warp and ret from the previous-frame texture at that UV.

The renderer is expected to bind prev_texture to the sampler_main_texture slot when running the warp pipeline so the MD2 convention “sample the previous frame at the warped UV” lands naturally. Helper functions (GetPixel / GetBlur*) therefore also read from prev_texture’s view.