Fix crash if the BLAS turned out to be completely empty
This commit is contained in:
parent
6f1f33e90d
commit
bd6101bf13
1 changed files with 4 additions and 1 deletions
|
|
@ -124,7 +124,10 @@ void CPUAccelStruct::Update()
|
|||
|
||||
std::unique_ptr<CPUBottomLevelAccelStruct> CPUAccelStruct::CreateBLAS(int indexStart, int indexCount)
|
||||
{
|
||||
return std::make_unique<CPUBottomLevelAccelStruct>(Mesh->Mesh.Vertices.Data(), Mesh->Mesh.Vertices.Size(), &Mesh->Mesh.Indexes[indexStart], indexCount, Scratch);
|
||||
auto accelstruct = std::make_unique<CPUBottomLevelAccelStruct>(Mesh->Mesh.Vertices.Data(), Mesh->Mesh.Vertices.Size(), &Mesh->Mesh.Indexes[indexStart], indexCount, Scratch);
|
||||
if (accelstruct->GetRoot() == -1)
|
||||
return {};
|
||||
return accelstruct;
|
||||
}
|
||||
|
||||
static FVector3 SwapYZ(const FVector3& v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue