mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
remove usage of Buffer IDs in clear code
This commit is contained in:
parent
8465a64104
commit
a21bbdccf0
@ -208,7 +208,7 @@ impl<A: HalApi> BakedCommands<A> {
|
||||
}
|
||||
}
|
||||
|
||||
for (buffer_id, (buffer, mut ranges)) in uninitialized_ranges_per_buffer {
|
||||
for (buffer, mut ranges) in uninitialized_ranges_per_buffer.into_values() {
|
||||
// Collapse touching ranges.
|
||||
ranges.sort_by_key(|r| r.start);
|
||||
for i in (1..ranges.len()).rev() {
|
||||
@ -234,7 +234,7 @@ impl<A: HalApi> BakedCommands<A> {
|
||||
let raw_buf = buffer
|
||||
.raw
|
||||
.get(snatch_guard)
|
||||
.ok_or(DestroyedBufferError(buffer_id))?;
|
||||
.ok_or(DestroyedBufferError(buffer.error_ident()))?;
|
||||
|
||||
unsafe {
|
||||
self.encoder.transition_buffers(
|
||||
|
@ -243,7 +243,7 @@ pub(crate) struct BakedCommands<A: HalApi> {
|
||||
texture_memory_actions: CommandBufferTextureMemoryActions<A>,
|
||||
}
|
||||
|
||||
pub(crate) struct DestroyedBufferError(pub id::BufferId);
|
||||
pub(crate) struct DestroyedBufferError(pub ResourceErrorIdent);
|
||||
pub(crate) struct DestroyedTextureError(pub ResourceErrorIdent);
|
||||
|
||||
/// The mutable state of a [`CommandBuffer`].
|
||||
|
@ -372,8 +372,8 @@ pub enum QueueWriteError {
|
||||
pub enum QueueSubmitError {
|
||||
#[error(transparent)]
|
||||
Queue(#[from] DeviceError),
|
||||
#[error("Buffer {0:?} is destroyed")]
|
||||
DestroyedBuffer(id::BufferId),
|
||||
#[error("{0} has been destroyed")]
|
||||
DestroyedBuffer(ResourceErrorIdent),
|
||||
#[error("{0} has been destroyed")]
|
||||
DestroyedTexture(ResourceErrorIdent),
|
||||
#[error(transparent)]
|
||||
@ -1222,7 +1222,7 @@ impl Global {
|
||||
for buffer in cmd_buf_trackers.buffers.used_resources() {
|
||||
if buffer.raw.get(&snatch_guard).is_none() {
|
||||
return Err(QueueSubmitError::DestroyedBuffer(
|
||||
buffer.info.id(),
|
||||
buffer.error_ident(),
|
||||
));
|
||||
}
|
||||
buffer.info.use_at(submit_index);
|
||||
|
Loading…
Reference in New Issue
Block a user