若要在執行階段解壓縮 BVH 結構,您需要使用「XG」程式庫。解壓縮程序目前只會在 CPU 上執行,且為單一執行緒。您可以輕鬆建立並使用解壓縮器,如下列範例程式碼所示:
// Create a BVHComputer for the BVH DecompressionXGBVHComputer* bvhComputer = nullptr;DX::ThrowIfFailed(XGCreateBVHComputer( &bvhComputer ));bvhComputer->DecompressBVH(...);