Clean up decal behavior

Only update the mesh if a decal was truly created/destroyed
This commit is contained in:
Boondorl 2024-12-12 22:27:16 -05:00 committed by Nash Muhandes
commit 4d5bba8d02
4 changed files with 22 additions and 13 deletions

View file

@ -85,11 +85,14 @@ void CPUAccelStruct::FindFirstHit(const RayBBox& ray, int a, TraceHit* hit)
}
}
extern glcycle_t DynamicBLASTime;
void CPUAccelStruct::Update()
{
if (Mesh->UploadRanges.Index.Size() == 0)
return;
DynamicBLASTime.ResetAndClock();
InstanceCount = (Mesh->Mesh.IndexCount + IndexesPerBLAS - 1) / IndexesPerBLAS;
bool needsUpdate[32] = {};
@ -112,6 +115,7 @@ void CPUAccelStruct::Update()
DynamicBLAS[instance] = CreateBLAS(indexStart, indexEnd - indexStart);
}
}
DynamicBLASTime.Unclock();
CreateTLAS();
Upload();