From f57db150f2e9fa1f7e031ddc8cd8bcb5c66f1acb Mon Sep 17 00:00:00 2001 From: Olaroll Date: Sat, 8 Oct 2022 08:42:57 +0300 Subject: [PATCH] Fixed missing device feature in mipmap example (#3081) --- CHANGELOG.md | 1 + wgpu/examples/mipmap/main.rs | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d427e7579c..ef78b387f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/wgpu/examples/mipmap/main.rs b/wgpu/examples/mipmap/main.rs index 7e5e1a574c..70ecbd91a0 100644 --- a/wgpu/examples/mipmap/main.rs +++ b/wgpu/examples/mipmap/main.rs @@ -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;