remove usage of Buffer IDs in clear code

This commit is contained in:
teoxoy 2024-06-19 14:59:56 +02:00 committed by Teodor Tanasoaia
parent 8465a64104
commit a21bbdccf0
3 changed files with 6 additions and 6 deletions

View File

@ -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(

View File

@ -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`].

View File

@ -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);