mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
replace uses of Id.backend()
with A::VARIANT
This commit is contained in:
parent
7b89b6d959
commit
43177d78d6
@ -325,9 +325,7 @@ impl<A: HalApi> Binder<A> {
|
|||||||
bind_group: &Arc<BindGroup<A>>,
|
bind_group: &Arc<BindGroup<A>>,
|
||||||
offsets: &[wgt::DynamicOffset],
|
offsets: &[wgt::DynamicOffset],
|
||||||
) -> &'a [EntryPayload<A>] {
|
) -> &'a [EntryPayload<A>] {
|
||||||
let bind_group_id = bind_group.as_info().id();
|
log::trace!("\tBinding [{}] = group {}", index, bind_group.error_ident());
|
||||||
log::trace!("\tBinding [{}] = group {:?}", index, bind_group_id);
|
|
||||||
debug_assert_eq!(A::VARIANT, bind_group_id.backend());
|
|
||||||
|
|
||||||
let payload = &mut self.payloads[index];
|
let payload = &mut self.payloads[index];
|
||||||
payload.group = Some(bind_group.clone());
|
payload.group = Some(bind_group.clone());
|
||||||
|
@ -49,10 +49,9 @@ impl<A: HalApi> QueryResetMap<A> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
raw_encoder: &mut A::CommandEncoder,
|
raw_encoder: &mut A::CommandEncoder,
|
||||||
query_set_storage: &Storage<QuerySet<A>>,
|
query_set_storage: &Storage<QuerySet<A>>,
|
||||||
backend: wgt::Backend,
|
|
||||||
) -> Result<(), id::QuerySetId> {
|
) -> Result<(), id::QuerySetId> {
|
||||||
for (query_set_id, (state, epoch)) in self.map.drain() {
|
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)?;
|
let query_set = query_set_storage.get(id).map_err(|_| id)?;
|
||||||
|
|
||||||
debug_assert_eq!(state.len(), query_set.desc.count as usize);
|
debug_assert_eq!(state.len(), query_set.desc.count as usize);
|
||||||
|
@ -2435,11 +2435,7 @@ impl Global {
|
|||||||
|
|
||||||
cmd_buf_data
|
cmd_buf_data
|
||||||
.pending_query_resets
|
.pending_query_resets
|
||||||
.reset_queries(
|
.reset_queries(transit, &query_set_guard)
|
||||||
transit,
|
|
||||||
&query_set_guard,
|
|
||||||
cmd_buf.device.info.id().backend(),
|
|
||||||
)
|
|
||||||
.map_err(RenderCommandError::InvalidQuerySet)
|
.map_err(RenderCommandError::InvalidQuerySet)
|
||||||
.map_pass_err(PassErrorScope::QueryReset)?;
|
.map_pass_err(PassErrorScope::QueryReset)?;
|
||||||
|
|
||||||
|
@ -569,8 +569,6 @@ impl<A: HalApi> Device<A> {
|
|||||||
desc: &resource::BufferDescriptor,
|
desc: &resource::BufferDescriptor,
|
||||||
transient: bool,
|
transient: bool,
|
||||||
) -> Result<Buffer<A>, resource::CreateBufferError> {
|
) -> Result<Buffer<A>, resource::CreateBufferError> {
|
||||||
debug_assert_eq!(self.as_info().id().backend(), A::VARIANT);
|
|
||||||
|
|
||||||
self.check_is_valid()?;
|
self.check_is_valid()?;
|
||||||
|
|
||||||
if desc.size > self.limits.max_buffer_size {
|
if desc.size > self.limits.max_buffer_size {
|
||||||
@ -679,8 +677,6 @@ impl<A: HalApi> Device<A> {
|
|||||||
format_features: wgt::TextureFormatFeatures,
|
format_features: wgt::TextureFormatFeatures,
|
||||||
clear_mode: resource::TextureClearMode<A>,
|
clear_mode: resource::TextureClearMode<A>,
|
||||||
) -> Texture<A> {
|
) -> Texture<A> {
|
||||||
debug_assert_eq!(self.as_info().id().backend(), A::VARIANT);
|
|
||||||
|
|
||||||
Texture {
|
Texture {
|
||||||
inner: Snatchable::new(resource::TextureInner::Native { raw: hal_texture }),
|
inner: Snatchable::new(resource::TextureInner::Native { raw: hal_texture }),
|
||||||
device: self.clone(),
|
device: self.clone(),
|
||||||
@ -710,8 +706,6 @@ impl<A: HalApi> Device<A> {
|
|||||||
hal_buffer: A::Buffer,
|
hal_buffer: A::Buffer,
|
||||||
desc: &resource::BufferDescriptor,
|
desc: &resource::BufferDescriptor,
|
||||||
) -> Buffer<A> {
|
) -> Buffer<A> {
|
||||||
debug_assert_eq!(self.as_info().id().backend(), A::VARIANT);
|
|
||||||
|
|
||||||
Buffer {
|
Buffer {
|
||||||
raw: Snatchable::new(hal_buffer),
|
raw: Snatchable::new(hal_buffer),
|
||||||
device: self.clone(),
|
device: self.clone(),
|
||||||
|
Loading…
Reference in New Issue
Block a user