Skip to content

Commit

Permalink
fix demo for new wgpu version
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jul 10, 2022
1 parent 8201d0a commit eb7870c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions examples/shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
struct VertexOutput {
[[location(0)]] coord: vec2<f32>;
[[location(1)]] instance: f32;
[[builtin(position)]] pos: vec4<f32>;
@location(0) coord: vec2<f32>,
@location(1) instance: f32,
@builtin(position) pos: vec4<f32>,
};

[[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;

Expand All @@ -24,8 +24,8 @@ fn vs_main(
return out;
}

[[stage(fragment)]]
fn fs_main(in: VertexOutput) -> [[location(0)]] vec4<f32> {
@fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
var c: vec2<f32> = vec2<f32>(-0.79, 0.15);
if (in.instance == 0.0) {
c = vec2<f32>(-1.476, 0.0);
Expand Down

0 comments on commit eb7870c

Please sign in to comment.