1import package::fullscreen_vertex_shader::FullscreenVertexOutput;3@group(0) @binding(0)4var material_id_texture: texture_2d<u32>;6struct FragmentOutput {7 @builtin(frag_depth) frag_depth: f32,9}11@fragment12fn fragment(in: FullscreenVertexOutput) -> FragmentOutput {13 var out: FragmentOutput;14 // Depth is stored as unorm, so we are dividing the u8 by 255.0 here.15 out.frag_depth = f32(textureLoad(material_id_texture, vec2<i32>(in.position.xy), 0).x) / 255.0;16 return out;17}