diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 643e5ffa6..39fe1d91d 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -507,14 +507,12 @@ impl Global { // But no point in erroring over that nuance here! if let Some(range) = range { unsafe { - state - .raw_encoder - .reset_queries(query_set.raw.as_ref().unwrap(), range); + state.raw_encoder.reset_queries(query_set.raw(), range); } } Some(hal::ComputePassTimestampWrites { - query_set: query_set.raw.as_ref().unwrap(), + query_set: query_set.raw(), beginning_of_pass_write_index: tw.beginning_of_pass_write_index, end_of_pass_write_index: tw.end_of_pass_write_index, }) diff --git a/wgpu-core/src/command/query.rs b/wgpu-core/src/command/query.rs index 35facbf26..382fa2d29 100644 --- a/wgpu-core/src/command/query.rs +++ b/wgpu-core/src/command/query.rs @@ -255,7 +255,7 @@ pub(super) fn end_occlusion_query( active_query: &mut Option<(Arc>, u32)>, ) -> Result<(), QueryUseError> { if let Some((query_set, query_index)) = active_query.take() { - unsafe { raw_encoder.end_query(query_set.raw.as_ref().unwrap(), query_index) }; + unsafe { raw_encoder.end_query(query_set.raw(), query_index) }; Ok(()) } else { Err(QueryUseError::AlreadyStopped) diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 8c00e0d30..86a9eef26 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1193,7 +1193,7 @@ impl<'d, A: HalApi> RenderPassInfo<'d, A> { } Some(hal::RenderPassTimestampWrites { - query_set: query_set.raw.as_ref().unwrap(), + query_set: query_set.raw(), beginning_of_pass_write_index: tw.beginning_of_pass_write_index, end_of_pass_write_index: tw.end_of_pass_write_index, }) @@ -1203,7 +1203,7 @@ impl<'d, A: HalApi> RenderPassInfo<'d, A> { let occlusion_query_set_hal = if let Some(query_set) = occlusion_query_set.as_ref() { query_set.same_device(device)?; - Some(query_set.raw.as_ref().unwrap()) + Some(query_set.raw()) } else { None };