{} // Discard the fragment if the source texture doesn't // have the stencil_val. @fragment fn frag_check_src_stencil(input : VertexOutputs) { // Load the source stencil value. let src_val : u32 = textureLoadGeneral( src_tex, vec2u(input.position.xy) - params.origin, 0u)[0]; // Discard it if it doesn't contain the stencil reference. if ((src_val & input.stencil_val) == 0u) { discard; } }