Skip to content

Commit

Permalink
chore: update tests, one failing
Browse files Browse the repository at this point in the history
  • Loading branch information
FL33TW00D committed Apr 2, 2023
1 parent ca922dd commit 27a6836
Show file tree
Hide file tree
Showing 24 changed files with 45 additions and 9 deletions.
2 changes: 1 addition & 1 deletion wgpu-core/src/command/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
clear_value: (0.0, 0),
}),
multiview: self.multiview,
timestamp_writes: &[], //TODO
timestamp_writes: &[],
};
unsafe {
raw.begin_render_pass(&desc);
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/examples/halmark/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ impl<A: hal::Api> Example<A> {
})],
depth_stencil_attachment: None,
multiview: None,
timestamp_writes: &[],
};
unsafe {
ctx.encoder.begin_render_pass(&pass_desc);
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/examples/raw-gles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ fn fill_screen(exposed: &hal::ExposedAdapter<hal::api::Gles>, width: u32, height
})],
depth_stencil_attachment: None,
multiview: None,
timestamp_writes: &[],
};
unsafe {
encoder.begin_encoding(None).unwrap();
Expand Down
7 changes: 5 additions & 2 deletions wgpu/examples/boids/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ impl framework::Example for Example {
label: None,
color_attachments: &color_attachments,
depth_stencil_attachment: None,
timestamp_writes: &[],
};

// get command encoder
Expand All @@ -295,8 +296,10 @@ impl framework::Example for Example {
command_encoder.push_debug_group("compute boid movement");
{
// compute pass
let mut cpass =
command_encoder.begin_compute_pass(&wgpu::ComputePassDescriptor { label: None });
let mut cpass = command_encoder.begin_compute_pass(&wgpu::ComputePassDescriptor {
label: None,
timestamp_writes: &[],
});
cpass.set_pipeline(&self.compute_pipeline);
cpass.set_bind_group(0, &self.particle_bind_groups[self.frame_num % 2], &[]);
cpass.dispatch_workgroups(self.work_group_count, 1, 1);
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/bunnymark/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ impl framework::Example for Example {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});
rpass.set_pipeline(&self.pipeline);
rpass.set_bind_group(0, &self.global_group, &[]);
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/capture/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ async fn create_red_image_with_dimensions(
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});

// Copy the data from the texture to the buffer
Expand Down
2 changes: 2 additions & 0 deletions wgpu/examples/conservative-raster/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ impl framework::Example for Example {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});

rpass.set_pipeline(&self.pipeline_triangle_conservative);
Expand All @@ -295,6 +296,7 @@ impl framework::Example for Example {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});

rpass.set_pipeline(&self.pipeline_upscale);
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/cube/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ impl framework::Example for Example {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});
rpass.push_debug_group("Prepare data for draw.");
rpass.set_pipeline(&self.pipeline);
Expand Down
4 changes: 4 additions & 0 deletions wgpu/examples/hello-compute/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn test_compute_1() {
TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true),
|ctx| {
let input = &[1, 2, 3, 4];
Expand All @@ -36,6 +37,7 @@ fn test_compute_2() {
TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true),
|ctx| {
let input = &[5, 23, 10, 9];
Expand All @@ -57,6 +59,7 @@ fn test_compute_overflow() {
TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true),
|ctx| {
let input = &[77031, 837799, 8400511, 63728127];
Expand All @@ -77,6 +80,7 @@ fn test_multithreaded_compute() {
TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::COMPUTE_SHADERS)
.limits(wgpu::Limits::downlevel_defaults())
.features(wgpu::Features::TIMESTAMP_QUERY)
.specific_failure(None, None, Some("V3D"), true)
// https://github.com/gfx-rs/wgpu/issues/3250
.specific_failure(Some(wgpu::Backends::GL), None, Some("llvmpipe"), true),
Expand Down
12 changes: 6 additions & 6 deletions wgpu/examples/hello-triangle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ async fn run(event_loop: EventLoop<()>, window: Window) {

fn resolve_timestamps(destination_buffer: &wgpu::Buffer, timestamp_period: f32) {
{
let timestamp_view = destination_buffer
.slice(..(std::mem::size_of::<u64>() * 2) as wgpu::BufferAddress)
.get_mapped_range();
let timestamp_view = destination_buffer
.slice(..(std::mem::size_of::<u64>() * 2) as wgpu::BufferAddress)
.get_mapped_range();

let timestamps: &[u64] = bytemuck::cast_slice(&timestamp_view);
let elapsed_ns = (timestamps[1] - timestamps[0]) as f64 * timestamp_period as f64;
log::info!("Elapsed time: {:.2} μs", elapsed_ns / 1000.0);
let timestamps: &[u64] = bytemuck::cast_slice(&timestamp_view);
let elapsed_ns = (timestamps[1] - timestamps[0]) as f64 * timestamp_period as f64;
log::info!("Elapsed time: {:.2} μs", elapsed_ns / 1000.0);
}
destination_buffer.unmap();
}
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/hello-windows/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ async fn run(event_loop: EventLoop<()>, viewports: Vec<(Window, wgpu::Color)>) {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});
}

Expand Down
2 changes: 2 additions & 0 deletions wgpu/examples/mipmap/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ impl Example {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});
if let Some(ref query_sets) = query_sets {
rpass.write_timestamp(&query_sets.timestamp, timestamp_query_index_base);
Expand Down Expand Up @@ -474,6 +475,7 @@ impl framework::Example for Example {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});
rpass.set_pipeline(&self.draw_pipeline);
rpass.set_bind_group(0, &self.bind_group, &[]);
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/msaa-line/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ impl framework::Example for Example {
label: None,
color_attachments: &[Some(rpass_color_attachment)],
depth_stencil_attachment: None,
timestamp_writes: &[],
})
.execute_bundles(iter::once(&self.bundle));
}
Expand Down
2 changes: 2 additions & 0 deletions wgpu/examples/shadow/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ impl framework::Example for Example {
}),
stencil_ops: None,
}),
timestamp_writes: &[],
});
pass.set_pipeline(&self.shadow_pass.pipeline);
pass.set_bind_group(0, &self.shadow_pass.bind_group, &[]);
Expand Down Expand Up @@ -822,6 +823,7 @@ impl framework::Example for Example {
}),
stencil_ops: None,
}),
timestamp_writes: &[],
});
pass.set_pipeline(&self.forward_pass.pipeline);
pass.set_bind_group(0, &self.forward_pass.bind_group, &[]);
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/skybox/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ impl framework::Example for Skybox {
}),
stencil_ops: None,
}),
timestamp_writes: &[],
});

rpass.set_bind_group(0, &self.bind_group, &[]);
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/stencil-triangles/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl framework::Example for Triangles {
store: true,
}),
}),
timestamp_writes: &[],
});

rpass.set_stencil_reference(1);
Expand Down
1 change: 1 addition & 0 deletions wgpu/examples/texture-arrays/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ impl framework::Example for Example {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});

rpass.set_pipeline(&self.pipeline);
Expand Down
3 changes: 3 additions & 0 deletions wgpu/examples/water/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ impl framework::Example for Example {
}),
stencil_ops: None,
}),
timestamp_writes: &[],
});

rpass.execute_bundles([&self.terrain_bundle]);
Expand All @@ -780,6 +781,7 @@ impl framework::Example for Example {
}),
stencil_ops: None,
}),
timestamp_writes: &[],
});
rpass.set_pipeline(&self.terrain_pipeline);
rpass.set_bind_group(0, &self.terrain_normal_bind_group, &[]);
Expand All @@ -804,6 +806,7 @@ impl framework::Example for Example {
depth_ops: None,
stencil_ops: None,
}),
timestamp_writes: &[],
});

rpass.set_pipeline(&self.water_pipeline);
Expand Down
2 changes: 2 additions & 0 deletions wgpu/tests/regression/issue_3457.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ fn pass_reset_vertex_buffer() {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});

double_rpass.set_pipeline(&double_pipeline);
Expand Down Expand Up @@ -174,6 +175,7 @@ fn pass_reset_vertex_buffer() {
},
})],
depth_stencil_attachment: None,
timestamp_writes: &[],
});

single_rpass.set_pipeline(&single_pipeline);
Expand Down
1 change: 1 addition & 0 deletions wgpu/tests/shader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ fn shader_input_output_test(

let mut cpass = encoder.begin_compute_pass(&ComputePassDescriptor {
label: Some(&format!("cpass {test_name}")),
timestamp_writes: &[],
});
cpass.set_pipeline(&pipeline);
cpass.set_bind_group(0, &bg, &[]);
Expand Down
1 change: 1 addition & 0 deletions wgpu/tests/shader_primitive_index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ fn pulling_common(
})],
depth_stencil_attachment: None,
label: None,
timestamp_writes: &[],
});

rpass.set_pipeline(&pipeline);
Expand Down
1 change: 1 addition & 0 deletions wgpu/tests/shader_view_format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ fn reinterpret(
})],
depth_stencil_attachment: None,
label: None,
timestamp_writes: &[],
});
rpass.set_pipeline(&pipeline);
rpass.set_bind_group(0, &bind_group, &[]);
Expand Down
1 change: 1 addition & 0 deletions wgpu/tests/vertex_indices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ fn pulling_common(
})],
depth_stencil_attachment: None,
label: None,
timestamp_writes: &[],
});

rpass.set_pipeline(&pipeline);
Expand Down
4 changes: 4 additions & 0 deletions wgpu/tests/zero_init_texture_after_discard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ impl<'ctx> TestCase<'ctx> {
store: true,
}),
}),
timestamp_writes: &[],
});
ctx.queue.submit([encoder.finish()]);
} else {
Expand Down Expand Up @@ -243,6 +244,7 @@ impl<'ctx> TestCase<'ctx> {
}),
},
),
timestamp_writes: &[],
});
}

Expand All @@ -266,6 +268,7 @@ impl<'ctx> TestCase<'ctx> {
}),
},
),
timestamp_writes: &[],
});
}

Expand All @@ -289,6 +292,7 @@ impl<'ctx> TestCase<'ctx> {
}),
},
),
timestamp_writes: &[],
});
}

Expand Down

0 comments on commit 27a6836

Please sign in to comment.