use Registry.get() instead of Registry.read().get_owned()

This commit is contained in:
teoxoy 2024-07-01 11:12:31 +02:00 committed by Teodor Tanasoaia
parent 3547138716
commit c4d71d9af5

View File

@ -304,7 +304,7 @@ impl Global {
match CommandBuffer::lock_encoder(hub, encoder_id) { match CommandBuffer::lock_encoder(hub, encoder_id) {
Ok(cmd_buf) => { Ok(cmd_buf) => {
arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes { arc_desc.timestamp_writes = if let Some(tw) = desc.timestamp_writes {
let Ok(query_set) = hub.query_sets.read().get_owned(tw.query_set) else { let Ok(query_set) = hub.query_sets.get(tw.query_set) else {
return ( return (
ComputePass::new(None, arc_desc), ComputePass::new(None, arc_desc),
Some(CommandEncoderError::InvalidTimestampWritesQuerySetId( Some(CommandEncoderError::InvalidTimestampWritesQuerySetId(
@ -405,8 +405,7 @@ impl Global {
Some(ArcPassTimestampWrites { Some(ArcPassTimestampWrites {
query_set: hub query_set: hub
.query_sets .query_sets
.read() .get(tw.query_set)
.get_owned(tw.query_set)
.map_err(|_| ComputePassErrorInner::InvalidQuerySet(tw.query_set)) .map_err(|_| ComputePassErrorInner::InvalidQuerySet(tw.query_set))
.map_pass_err(scope)?, .map_pass_err(scope)?,
beginning_of_pass_write_index: tw.beginning_of_pass_write_index, beginning_of_pass_write_index: tw.beginning_of_pass_write_index,
@ -1002,8 +1001,7 @@ impl Global {
let hub = A::hub(self); let hub = A::hub(self);
let bind_group = hub let bind_group = hub
.bind_groups .bind_groups
.read() .get(bind_group_id)
.get_owned(bind_group_id)
.map_err(|_| ComputePassErrorInner::InvalidBindGroupId(bind_group_id)) .map_err(|_| ComputePassErrorInner::InvalidBindGroupId(bind_group_id))
.map_pass_err(scope)?; .map_pass_err(scope)?;
@ -1034,8 +1032,7 @@ impl Global {
let hub = A::hub(self); let hub = A::hub(self);
let pipeline = hub let pipeline = hub
.compute_pipelines .compute_pipelines
.read() .get(pipeline_id)
.get_owned(pipeline_id)
.map_err(|_| ComputePassErrorInner::InvalidPipelineId(pipeline_id)) .map_err(|_| ComputePassErrorInner::InvalidPipelineId(pipeline_id))
.map_pass_err(scope)?; .map_pass_err(scope)?;
@ -1182,8 +1179,7 @@ impl Global {
let hub = A::hub(self); let hub = A::hub(self);
let query_set = hub let query_set = hub
.query_sets .query_sets
.read() .get(query_set_id)
.get_owned(query_set_id)
.map_err(|_| ComputePassErrorInner::InvalidQuerySet(query_set_id)) .map_err(|_| ComputePassErrorInner::InvalidQuerySet(query_set_id))
.map_pass_err(scope)?; .map_pass_err(scope)?;
@ -1207,8 +1203,7 @@ impl Global {
let hub = A::hub(self); let hub = A::hub(self);
let query_set = hub let query_set = hub
.query_sets .query_sets
.read() .get(query_set_id)
.get_owned(query_set_id)
.map_err(|_| ComputePassErrorInner::InvalidQuerySet(query_set_id)) .map_err(|_| ComputePassErrorInner::InvalidQuerySet(query_set_id))
.map_pass_err(scope)?; .map_pass_err(scope)?;