Skip to content

Commit c95eb8f

Browse files
committed
Implements Device::create_acceleration_structure().
1 parent d294535 commit c95eb8f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

wgpu-hal/src/metal/device.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,9 +1686,17 @@ impl crate::Device for super::Device {
16861686

16871687
unsafe fn create_acceleration_structure(
16881688
&self,
1689-
_desc: &crate::AccelerationStructureDescriptor,
1689+
descriptor: &crate::AccelerationStructureDescriptor,
16901690
) -> Result<super::AccelerationStructure, crate::DeviceError> {
1691-
unimplemented!()
1691+
// self.counters.acceleration_structures.add(1);
1692+
let device = self.shared.device.lock();
1693+
autoreleasepool(|_| {
1694+
Ok(super::AccelerationStructure {
1695+
raw: device
1696+
.newAccelerationStructureWithSize(descriptor.size as usize)
1697+
.ok_or(crate::DeviceError::OutOfMemory)?,
1698+
})
1699+
})
16921700
}
16931701

16941702
unsafe fn destroy_acceleration_structure(

0 commit comments

Comments
 (0)