From eb7870c72bcc692510a38c4e612e78aca2c22867 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Sun, 10 Jul 2022 22:49:35 +0200 Subject: [PATCH] fix demo for new wgpu version --- examples/demo.rs | 2 +- examples/shader.wgsl | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/demo.rs b/examples/demo.rs index 8b9e9b6..70926fa 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -48,7 +48,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) { .request_device( &wgpu::DeviceDescriptor { label: None, - features: GpuProfiler::REQUIRED_WGPU_FEATURES, + features: GpuProfiler::ALL_WGPU_TIMER_FEATURES, limits: wgpu::Limits::default(), }, None, diff --git a/examples/shader.wgsl b/examples/shader.wgsl index 969b065..1f7eb98 100644 --- a/examples/shader.wgsl +++ b/examples/shader.wgsl @@ -1,13 +1,13 @@ struct VertexOutput { - [[location(0)]] coord: vec2; - [[location(1)]] instance: f32; - [[builtin(position)]] pos: vec4; + @location(0) coord: vec2, + @location(1) instance: f32, + @builtin(position) pos: vec4, }; -[[stage(vertex)]] +@vertex fn vs_main( - [[builtin(vertex_index)]] vertex_index: u32, - [[builtin(instance_index)]] instance_index: u32, + @builtin(vertex_index) vertex_index: u32, + @builtin(instance_index) instance_index: u32, ) -> VertexOutput { var out: VertexOutput; @@ -24,8 +24,8 @@ fn vs_main( return out; } -[[stage(fragment)]] -fn fs_main(in: VertexOutput) -> [[location(0)]] vec4 { +@fragment +fn fs_main(in: VertexOutput) -> @location(0) vec4 { var c: vec2 = vec2(-0.79, 0.15); if (in.instance == 0.0) { c = vec2(-1.476, 0.0);