replace uses of Id.backend() with A::VARIANT

This commit is contained in:
teoxoy 2024-06-19 14:26:32 +02:00 committed by Teodor Tanasoaia
parent 7b89b6d959
commit 43177d78d6
4 changed files with 3 additions and 16 deletions

View File

@ -325,9 +325,7 @@ impl<A: HalApi> Binder<A> {
bind_group: &Arc<BindGroup<A>>,
offsets: &[wgt::DynamicOffset],
) -> &'a [EntryPayload<A>] {
let bind_group_id = bind_group.as_info().id();
log::trace!("\tBinding [{}] = group {:?}", index, bind_group_id);
debug_assert_eq!(A::VARIANT, bind_group_id.backend());
log::trace!("\tBinding [{}] = group {}", index, bind_group.error_ident());
let payload = &mut self.payloads[index];
payload.group = Some(bind_group.clone());

View File

@ -49,10 +49,9 @@ impl<A: HalApi> QueryResetMap<A> {
&mut self,
raw_encoder: &mut A::CommandEncoder,
query_set_storage: &Storage<QuerySet<A>>,
backend: wgt::Backend,
) -> Result<(), id::QuerySetId> {
for (query_set_id, (state, epoch)) in self.map.drain() {
let id = Id::zip(query_set_id, epoch, backend);
let id = Id::zip(query_set_id, epoch, A::VARIANT);
let query_set = query_set_storage.get(id).map_err(|_| id)?;
debug_assert_eq!(state.len(), query_set.desc.count as usize);

View File

@ -2435,11 +2435,7 @@ impl Global {
cmd_buf_data
.pending_query_resets
.reset_queries(
transit,
&query_set_guard,
cmd_buf.device.info.id().backend(),
)
.reset_queries(transit, &query_set_guard)
.map_err(RenderCommandError::InvalidQuerySet)
.map_pass_err(PassErrorScope::QueryReset)?;

View File

@ -569,8 +569,6 @@ impl<A: HalApi> Device<A> {
desc: &resource::BufferDescriptor,
transient: bool,
) -> Result<Buffer<A>, resource::CreateBufferError> {
debug_assert_eq!(self.as_info().id().backend(), A::VARIANT);
self.check_is_valid()?;
if desc.size > self.limits.max_buffer_size {
@ -679,8 +677,6 @@ impl<A: HalApi> Device<A> {
format_features: wgt::TextureFormatFeatures,
clear_mode: resource::TextureClearMode<A>,
) -> Texture<A> {
debug_assert_eq!(self.as_info().id().backend(), A::VARIANT);
Texture {
inner: Snatchable::new(resource::TextureInner::Native { raw: hal_texture }),
device: self.clone(),
@ -710,8 +706,6 @@ impl<A: HalApi> Device<A> {
hal_buffer: A::Buffer,
desc: &resource::BufferDescriptor,
) -> Buffer<A> {
debug_assert_eq!(self.as_info().id().backend(), A::VARIANT);
Buffer {
raw: Snatchable::new(hal_buffer),
device: self.clone(),