const USER_WARP_VERTEX: &str = r#"
struct VertexOutput {
@builtin(position) position: vec4<f32>,
@location(0) uv: vec2<f32>,
@location(1) uv_screen: vec2<f32>,
}
@vertex
fn vs_main(
@location(0) pos_clip: vec2<f32>,
@location(1) uv_warp: vec2<f32>,
) -> VertexOutput {
var out: VertexOutput;
out.position = vec4<f32>(pos_clip, 0.0, 1.0);
out.uv = uv_warp;
out.uv_screen = pos_clip * 0.5 + vec2<f32>(0.5);
return out;
}
"#;Expand description
Warp-pass vertex shader. Consumes the same WarpVertex layout the
renderer uses for the default warp pipeline (pos_clip: vec2<f32>
at @location(0) plus uv_warp: vec2<f32> at @location(1)) so
switching between the default and user pipelines doesn’t change
vertex buffer plumbing on the renderer side.
Outputs uv (the per-pixel rasterised warp UV) and uv_screen (the
screen-space [0, 1] UV recovered from pos_clip, kept for parity
with warp.wgsl’s built-in shaders).