// Vertex shader bindings struct VertexOutput { [[location(0)]] tex_coord: vec2; [[builtin(position)]] position: vec4; }; [[block]] struct Locals { transform: mat4x4; }; [[group(0), binding(2)]] var r_locals: Locals; [[stage(vertex)]] fn vs_main( [[location(0)]] position: vec2, ) -> VertexOutput { var out: VertexOutput; out.tex_coord = position * vec2(0.5, -0.5) + 0.5; out.position = r_locals.transform * vec4(position, 0.0, 1.0); return out; } // Fragment shader bindings [[group(0), binding(0)]] var r_tex_color: texture_2d; [[group(0), binding(1)]] var r_tex_sampler: sampler; [[stage(fragment)]] fn fs_main([[location(0)]] tex_coord: vec2) -> [[location(0)]] vec4 { return textureSample(r_tex_color, r_tex_sampler, tex_coord); }