[core] Provide an explicit type for some CommandBuffer pointers. (#5512)

This commit is contained in:
Jim Blandy 2024-04-10 16:51:56 -07:00 committed by GitHub
parent cc0ee7bcbd
commit 8289711b65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -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<A>> =
CommandBuffer::get_encoder(hub, encoder_id).map_pass_err(pass_scope)?;
let device = &cmd_buf.device;
if !device.is_valid() {
return Err(ComputePassErrorInner::InvalidDevice(

View File

@ -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<A>> =
CommandBuffer::get_encoder(hub, encoder_id).map_pass_err(pass_scope)?;
let device = &cmd_buf.device;
let snatch_guard = device.snatchable_lock.read();