Remove get_buffer alias of resolve_buffer_id

This commit is contained in:
Andy Leiserson authored and Teodor Tanasoaia committed 2025-10-30 13:52:58 +01:00
1 parent 5ac2ed19cb
commit c6dc8eeac5
2 files changed
+9 -15

No files matched your search

+1 -8
View File
@@ -434,20 +434,13 @@ impl Player {
}
}
fn resolve_buffer_id(
pub fn resolve_buffer_id(
&self,
id: wgc::id::PointerId<wgc::id::markers::Buffer>,
) -> Arc<wgc::resource::Buffer> {
self.buffers.get(&id).expect("invalid buffer").clone()
}
pub fn get_buffer(
&self,
id: wgc::id::PointerId<wgc::id::markers::Buffer>,
) -> Arc<wgc::resource::Buffer> {
self.resolve_buffer_id(id)
}
fn resolve_texture_id(
&self,
id: wgc::id::PointerId<wgc::id::markers::Texture>,
+8 -7
View File
@@ -103,7 +103,7 @@ impl Test<'_> {
println!("\t\t\tMapping...");
for expect in &self.expectations {
player
.get_buffer(expect.buffer)
.resolve_buffer_id(expect.buffer)
.map_async(
expect.offset,
Some(expect.data.len() as u64),
@@ -116,16 +116,17 @@ impl Test<'_> {
}
println!("\t\t\tWaiting...");
device.poll(wgt::PollType::Wait {
submission_index: None,
timeout: Some(std::time::Duration::from_secs(1)), // Tests really shouldn't need longer than that!
})
.unwrap();
device
.poll(wgt::PollType::Wait {
submission_index: None,
timeout: Some(std::time::Duration::from_secs(1)), // Tests really shouldn't need longer than that!
})
.unwrap();
for expect in self.expectations {
println!("\t\t\tChecking {}", expect.name);
let (ptr, size) = player
.get_buffer(expect.buffer)
.resolve_buffer_id(expect.buffer)
.get_mapped_range(expect.offset, Some(expect.data.len() as wgt::BufferAddress))
.unwrap();
let contents = unsafe { slice::from_raw_parts(ptr.as_ptr(), size as usize) };