From 8289711b655a7cb86e90e1f8554c48cccd1aec2f Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 10 Apr 2024 16:51:56 -0700 Subject: [PATCH] [core] Provide an explicit type for some CommandBuffer pointers. (#5512) --- wgpu-core/src/command/compute.rs | 4 +++- wgpu-core/src/command/render.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index b38324984..98f4360a6 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -36,6 +36,7 @@ use serde::Serialize; use thiserror::Error; +use std::sync::Arc; use std::{fmt, mem, str}; #[doc(hidden)] @@ -365,7 +366,8 @@ impl Global { let hub = A::hub(self); - let cmd_buf = CommandBuffer::get_encoder(hub, encoder_id).map_pass_err(pass_scope)?; + let cmd_buf: Arc> = + CommandBuffer::get_encoder(hub, encoder_id).map_pass_err(pass_scope)?; let device = &cmd_buf.device; if !device.is_valid() { return Err(ComputePassErrorInner::InvalidDevice( diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 4e887fea2..f4db9aaf3 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1343,7 +1343,8 @@ impl Global { let hub = A::hub(self); - let cmd_buf = CommandBuffer::get_encoder(hub, encoder_id).map_pass_err(pass_scope)?; + let cmd_buf: Arc> = + CommandBuffer::get_encoder(hub, encoder_id).map_pass_err(pass_scope)?; let device = &cmd_buf.device; let snatch_guard = device.snatchable_lock.read();