Fixed missing device feature in mipmap example (#3081)

This commit is contained in:
Olaroll
2022-10-08 08:42:57 +03:00
committed by GitHub
parent 02cc2ae234
commit f57db150f2
2 changed files with 9 additions and 5 deletions

View File

@@ -56,6 +56,7 @@ Add the `"wgsl"` feature, to enable WGSL shaders in `wgpu-core` and `wgpu`. Enab
#### General
- Bother to free the `hal::Api::CommandBuffer` when a `wgpu_core::command::CommandEncoder` is dropped. By @jimblandy in [#3069](https://github.com/gfx-rs/wgpu/pull/3069).
- Fixed the mipmap example by adding the missing WRITE_TIMESTAMP_INSIDE_PASSES feature. By @Olaroll in [#3081](https://github.com/gfx-rs/wgpu/pull/3081).
### Testing/Internal

View File

@@ -200,7 +200,9 @@ impl Example {
impl framework::Example for Example {
fn optional_features() -> wgpu::Features {
wgpu::Features::TIMESTAMP_QUERY | wgpu::Features::PIPELINE_STATISTICS_QUERY
wgpu::Features::TIMESTAMP_QUERY
| wgpu::Features::PIPELINE_STATISTICS_QUERY
| wgpu::Features::WRITE_TIMESTAMP_INSIDE_PASSES
}
fn init(
@@ -323,10 +325,11 @@ impl framework::Example for Example {
});
// If both kinds of query are supported, use queries
let query_sets = if device
.features()
.contains(wgpu::Features::TIMESTAMP_QUERY | wgpu::Features::PIPELINE_STATISTICS_QUERY)
{
let query_sets = if device.features().contains(
wgpu::Features::TIMESTAMP_QUERY
| wgpu::Features::PIPELINE_STATISTICS_QUERY
| wgpu::Features::WRITE_TIMESTAMP_INSIDE_PASSES,
) {
// For N total mips, it takes N - 1 passes to generate them, and we're measuring those.
let mip_passes = MIP_LEVEL_COUNT - 1;