Alexander Meißner
Alexander Meißner
> Glad there didn't need to be any wgpu-core changes Almost, had to remove the `Option` around the buffers and always pass the dummy zero buffer when computing the size...
> I just remembered that structures have minimum versions, and it seems [MTLIndirectAccelerationStructureInstanceDescriptor](https://developer.apple.com/documentation/metal/mtlindirectaccelerationstructureinstancedescriptor) required MacOS 14.0+ (probably should have checked that earlier...). Bumped the min required version even further up.
I also managed to reduce the issue with the acelleration structure not intersecting any rays to a perfect reproducer and it is wild: See the last commit "Bug reproducer", which...
> divide by zero Might be that it tries to normalize a zero-length vector. The modified example does simply duplicate triangles so that could cause some vectors to become zero....
> Most other resources are created with an auto release pool around them, is it possible that that is fixing this issue somehow? Added one in `Device::create_acceleration_structure()` but unfortunately that...
> the current implementation will not work due to it being possible to submit the encoders in a different order to the order they were recorded in Instead of calling...
> I've found something called a [MTLResidencySet](https://developer.apple.com/documentation/metal/mtlresidencyset) Interesting. > one per command buffer and add all indirectly used BLASes to it That is essentially where we are right now with...
I think I can simplify your counter example further: Imagine we build the same TLAS in two different command buffers, but we never submit (thus discard) the second. And then...
About `cargo run --bin wgpu-examples ray_traced_triangle` working, but `cargo xtask test ray_traced_triangle` not: I think I found a bug in the Metal driver. Acceleration structures don't work in headless mode....
> there is also a need to keep acceleration structures resident (I've listed potential solutions in https://github.com/gfx-rs/wgpu/pull/7660#issuecomment-2885596743) `MTLResidencySet` would also have to be exposed in metal-rs first. But I haven't...