fix: req. TIMESTAMP_QUERY feat. for <pass desc.>::timestamp_writes

This commit is contained in:
Erich Gubler 2024-11-05 14:51:46 -05:00
parent 080d99b5bf
commit 2e46a6c9c9
4 changed files with 19 additions and 1 deletions

View File

@ -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) - 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) ## 23.0.0 (2024-10-25)
### Themes of this release ### Themes of this release

View File

@ -308,6 +308,14 @@ impl Global {
}; };
arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes { 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() { let query_set = match hub.query_sets.get(tw.query_set).get() {
Ok(query_set) => query_set, Ok(query_set) => query_set,
Err(e) => return make_err(e.into(), arc_desc), Err(e) => return make_err(e.into(), arc_desc),

View File

@ -26,7 +26,7 @@ pub use timestamp_writes::PassTimestampWrites;
use self::memory_init::CommandBufferTextureMemoryActions; use self::memory_init::CommandBufferTextureMemoryActions;
use crate::device::{Device, DeviceError}; use crate::device::{Device, DeviceError, MissingFeatures};
use crate::lock::{rank, Mutex}; use crate::lock::{rank, Mutex};
use crate::snatch::SnatchGuard; use crate::snatch::SnatchGuard;
@ -642,6 +642,8 @@ pub enum CommandEncoderError {
InvalidColorAttachment(#[from] ColorAttachmentError), InvalidColorAttachment(#[from] ColorAttachmentError),
#[error(transparent)] #[error(transparent)]
InvalidResource(#[from] InvalidResourceError), InvalidResource(#[from] InvalidResourceError),
#[error(transparent)]
MissingFeatures(#[from] MissingFeatures),
} }
impl Global { impl Global {

View File

@ -1393,6 +1393,8 @@ impl Global {
}; };
arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes { 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()?; let query_set = query_sets.get(tw.query_set).get()?;
Some(ArcPassTimestampWrites { Some(ArcPassTimestampWrites {