Skip to content

Commit

Permalink
fix: req. TIMESTAMP_QUERY feat. for <pass desc.>::timestamp_writes
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Nov 6, 2024
1 parent 080d99b commit 2e46a6c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ Bottom level categories:

- Change the `DropCallback` API to use `FnOnce` instead of `FnMut`. By @jerzywilczek in [#6482](https://github.com/gfx-rs/wgpu/pull/6482)

### Bug Fixes

#### General

- Ensure that `Features::TIMESTAMP_QUERY` is set when using timestamp writes in render and compute passes. By @ErichDonGubler in [#6497](https://github.com/gfx-rs/wgpu/pull/6497).

## 23.0.0 (2024-10-25)

### Themes of this release
Expand Down
8 changes: 8 additions & 0 deletions wgpu-core/src/command/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,14 @@ impl Global {
};

arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes {
match cmd_buf
.device
.require_features(wgt::Features::TIMESTAMP_QUERY)
{
Ok(()) => (),
Err(e) => return make_err(e.into(), arc_desc),
}

let query_set = match hub.query_sets.get(tw.query_set).get() {
Ok(query_set) => query_set,
Err(e) => return make_err(e.into(), arc_desc),
Expand Down
4 changes: 3 additions & 1 deletion wgpu-core/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub use timestamp_writes::PassTimestampWrites;

use self::memory_init::CommandBufferTextureMemoryActions;

use crate::device::{Device, DeviceError};
use crate::device::{Device, DeviceError, MissingFeatures};
use crate::lock::{rank, Mutex};
use crate::snatch::SnatchGuard;

Expand Down Expand Up @@ -642,6 +642,8 @@ pub enum CommandEncoderError {
InvalidColorAttachment(#[from] ColorAttachmentError),
#[error(transparent)]
InvalidResource(#[from] InvalidResourceError),
#[error(transparent)]
MissingFeatures(#[from] MissingFeatures),
}

impl Global {
Expand Down
2 changes: 2 additions & 0 deletions wgpu-core/src/command/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,8 @@ impl Global {
};

arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes {
device.require_features(wgt::Features::TIMESTAMP_QUERY)?;

let query_set = query_sets.get(tw.query_set).get()?;

Some(ArcPassTimestampWrites {
Expand Down

0 comments on commit 2e46a6c

Please sign in to comment.