struct Output { [[builtin(position)]] Position : vec4; [[location(0)]] color : vec4; }; [[stage(vertex)]] fn main( [[builtin(vertex_index)]] VertexIndex : u32, [[builtin(instance_index)]] InstanceIndex : u32) -> Output { // TODO: remove workaround for Tint unary array access broke var zv : array, 4> = array, 4>( vec2(0.2, 0.2), vec2(0.3, 0.3), vec2(-0.1, -0.1), vec2(1.1, 1.1)); let z : f32 = zv[InstanceIndex].x; var output : Output; output.Position = vec4(0.5, 0.5, z, 1.0); var colors : array, 4> = array, 4>( vec4(1.0, 0.0, 0.0, 1.0), vec4(0.0, 1.0, 0.0, 1.0), vec4(0.0, 0.0, 1.0, 1.0), vec4(1.0, 1.0, 1.0, 1.0) ); output.color = colors[InstanceIndex]; return output; }