diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 83cc08a481..6fd3fb16fc 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -28,7 +28,9 @@ use crate::{ use thiserror::Error; use wgt::{BufferAddress, DynamicOffset}; -use super::{bind::BinderError, memory_init::CommandBufferTextureMemoryActions}; +use super::{ + bind::BinderError, memory_init::CommandBufferTextureMemoryActions, SimplifiedQueryType, +}; use crate::ray_tracing::TlasAction; use std::sync::Arc; use std::{fmt, mem::size_of, str}; @@ -309,6 +311,12 @@ impl Global { }; arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes { + let &PassTimestampWrites { + query_set, + beginning_of_pass_write_index: _, + end_of_pass_write_index: _, + } = tw; + match cmd_buf .device .require_features(wgt::Features::TIMESTAMP_QUERY) @@ -317,7 +325,7 @@ impl Global { 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(query_set).get() { Ok(query_set) => query_set, Err(e) => return make_err(e.into(), arc_desc), }; diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index db03e1c156..49318ecc97 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1392,7 +1392,13 @@ impl Global { }; arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes { - let query_set = query_sets.get(tw.query_set).get()?; + let &PassTimestampWrites { + query_set, + beginning_of_pass_write_index: _, + end_of_pass_write_index: _, + } = tw; + + let query_set = query_sets.get(query_set).get()?; device.require_features(wgt::Features::TIMESTAMP_QUERY)?;