microsoft / DirectX-Graphics-Samples

This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
MIT License
6k stars 2.02k forks source link

Changed MiniEngine RT sample to work with multiple BLASes #790

Closed stanard closed 2 years ago

stanard commented 2 years ago

The sample was designed to support multiple BLASes, but it had a bug which probably prevented it from working. All BLAS builds were assigned the same scratch buffer memory, but without a UAV barrier between builds, memory corruption could occur. This was probably avoided by only creating one BLAS. I updated the sample to create a BLAS per mesh and assign each build its own scratch buffer. The alternative was to issue UAV barriers, but this prevents the driver from batching (simultaneous) builds.