19var<uniform> globals: Globals; 23var<uniform> locals: Locals; 26 @builtin(position) position: vec4<f32>, 27 @location(0) tex_coords: vec2<f32>, 28 @location(1) color: vec4<f32>, 32fn vs_main(@builtin(vertex_index) vi: u32) -> VertexOutput { 33 let tc = vec2<f32>(f32(vi & 1u), 0.5 * f32(vi & 2u)); 34 let offset = vec2<f32>(tc.x * globals.size.x, tc.y * globals.size.y); 35 let pos = globals.mvp * vec4<f32>(locals.position + offset, 0.0, 1.0); 36 let color = vec4<f32>((vec4<u32>(locals.color) >> vec4<u32>(0u, 8u, 16u, 24u)) & vec4<u32>(255u)) / 255.0; 37 return VertexOutput(pos, tc, color); 42var tex: texture_2d<f32>; 48fn fs_main(vertex: VertexOutput) -> @location(0) vec4<f32> { 49 return vertex.color * textureSampleLevel(tex, sam, vertex.tex_coords, 0.0);