diff --git a/wgpu/examples/hello-triangle/main.rs b/wgpu/examples/hello-triangle/main.rs index c6015b341aa..d64d85476a5 100644 --- a/wgpu/examples/hello-triangle/main.rs +++ b/wgpu/examples/hello-triangle/main.rs @@ -127,7 +127,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) { depth_stencil_attachment: None, }); rpass.set_pipeline(&render_pipeline); - rpass.draw(0..3, 0..1); + rpass.draw(0..64, 0..1); } queue.submit(Some(encoder.finish())); diff --git a/wgpu/examples/hello-triangle/shader.wgsl b/wgpu/examples/hello-triangle/shader.wgsl index f84ccfe94da..b555f97d051 100644 --- a/wgpu/examples/hello-triangle/shader.wgsl +++ b/wgpu/examples/hello-triangle/shader.wgsl @@ -1,8 +1,72 @@ @vertex fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4 { - let x = f32(i32(in_vertex_index) - 1); - let y = f32(i32(in_vertex_index & 1u) * 2 - 1); - return vec4(x, y, 0.0, 1.0); + var pos = array,64>( + vec2(0.5, 0.7), + vec2(0.51, 0.7), + vec2(0.52, 0.7), + vec2(0.53, 0.7), + vec2(0.54, 0.7), + vec2(0.55, 0.7), + vec2(0.56, 0.7), + vec2(0.57, 0.7), + vec2(0.6, 0.7), + vec2(0.61, 0.7), + vec2(0.62, 0.7), + vec2(0.63, 0.7), + vec2(0.64, 0.7), + vec2(0.65, 0.7), + vec2(0.66, 0.7), + vec2(0.67, 0.7), + vec2(0.7, 0.7), + vec2(0.71, 0.7), + vec2(0.72, 0.7), + vec2(0.73, 0.7), + vec2(0.74, 0.7), + vec2(0.75, 0.7), + vec2(0.76, 0.7), + vec2(0.77, 0.7), + vec2(0.8, 0.7), + vec2(0.81, 0.7), + vec2(0.82, 0.7), + vec2(0.83, 0.7), + vec2(0.84, 0.7), + vec2(0.85, 0.7), + vec2(0.86, 0.7), + vec2(0.87, 0.7), + vec2(0.5, 0.72), + vec2(0.51, 0.72), + vec2(0.52, 0.72), + vec2(0.53, 0.72), + vec2(0.54, 0.72), + vec2(0.55, 0.72), + vec2(0.56, 0.72), + vec2(0.57, 0.72), + vec2(0.6, 0.74), + vec2(0.61, 0.74), + vec2(0.62, 0.74), + vec2(0.63, 0.74), + vec2(0.64, 0.74), + vec2(0.65, 0.74), + vec2(0.66, 0.74), + vec2(0.67, 0.74), + vec2(0.7, 0.76), + vec2(0.71, 0.76), + vec2(0.72, 0.76), + vec2(0.73, 0.76), + vec2(0.74, 0.76), + vec2(0.75, 0.76), + vec2(0.76, 0.76), + vec2(0.77, 0.76), + vec2(0.8, 0.78), + vec2(0.81, 0.78), + vec2(0.82, 0.78), + vec2(0.83, 0.78), + vec2(0.84, 0.78), + vec2(0.85, 0.78), + vec2(0.86, 0.78), + vec2(0.87, 0.78), + ); + return vec4(pos[in_vertex_index], 0.0, 1.0); } @fragment