Reducing memory usage

This commit is contained in:
Dynamitos
2024-08-07 21:19:33 +02:00
parent 819b541ff2
commit 64a26bfd57
37 changed files with 216 additions and 44 deletions
+9 -1
View File
@@ -29,9 +29,17 @@ void Mesh::load(ArchiveBuffer& buffer) {
Serialization::load(buffer, refId);
referencedMaterial = AssetRegistry::findMaterialInstance(refFolder, refId);
id = vertexData->allocateVertexData(vertexCount);
vertexData->deserializeMesh(id, buffer);
byteSize = vertexData->deserializeMesh(id, buffer);
blas = buffer.getGraphics()->createBottomLevelAccelerationStructure(Gfx::BottomLevelASCreateInfo{
.mesh = this,
});
vertexData->registerBottomLevelAccelerationStructure(blas);
}
uint64 Mesh::getCPUSize() const {
uint64 result = sizeof(Mesh);
result += byteSize;
return result;
}
uint64 Mesh::getGPUSize() const { return byteSize; }