Skip to content

Commit f57db15

Browse files
authored
Fixed missing device feature in mipmap example (#3081)
1 parent 02cc2ae commit f57db15

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Add the `"wgsl"` feature, to enable WGSL shaders in `wgpu-core` and `wgpu`. Enab
5656
#### General
5757

5858
- 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).
59+
- 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).
5960

6061
### Testing/Internal
6162

wgpu/examples/mipmap/main.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ impl Example {
200200

201201
impl framework::Example for Example {
202202
fn optional_features() -> wgpu::Features {
203-
wgpu::Features::TIMESTAMP_QUERY | wgpu::Features::PIPELINE_STATISTICS_QUERY
203+
wgpu::Features::TIMESTAMP_QUERY
204+
| wgpu::Features::PIPELINE_STATISTICS_QUERY
205+
| wgpu::Features::WRITE_TIMESTAMP_INSIDE_PASSES
204206
}
205207

206208
fn init(
@@ -323,10 +325,11 @@ impl framework::Example for Example {
323325
});
324326

325327
// If both kinds of query are supported, use queries
326-
let query_sets = if device
327-
.features()
328-
.contains(wgpu::Features::TIMESTAMP_QUERY | wgpu::Features::PIPELINE_STATISTICS_QUERY)
329-
{
328+
let query_sets = if device.features().contains(
329+
wgpu::Features::TIMESTAMP_QUERY
330+
| wgpu::Features::PIPELINE_STATISTICS_QUERY
331+
| wgpu::Features::WRITE_TIMESTAMP_INSIDE_PASSES,
332+
) {
330333
// For N total mips, it takes N - 1 passes to generate them, and we're measuring those.
331334
let mip_passes = MIP_LEVEL_COUNT - 1;
332335

0 commit comments

Comments
 (0)