Fixing some stuff

This commit is contained in:
Dynamitos
2024-07-19 10:42:59 +02:00
parent 3b6eb3ebcc
commit 819b541ff2
14 changed files with 225 additions and 238 deletions
+2
View File
@@ -66,6 +66,7 @@ void VertexData::updateMesh(entt::entity id, uint32 meshIndex, PMesh mesh, Compo
.worldPosition = Vector(inst.transformMatrix[3]),
.instanceData = inst,
.meshData = data,
.cullingOffset = meshletOffset,
.rayTracingScene = mesh->blas,
});
return;
@@ -149,6 +150,7 @@ void VertexData::createDescriptors() {
}
for (uint32 i = 0; i < transparentData.size(); ++i) {
transparentData[i].offsets.instanceOffset = instanceData.size();
cullingOffsets.add(transparentData[i].cullingOffset);
instanceData.add(transparentData[i].instanceData);
instanceMeshData.add(transparentData[i].meshData);
rayTracingScene.add(transparentData[i].rayTracingScene);
+1
View File
@@ -51,6 +51,7 @@ class VertexData {
Vector worldPosition;
InstanceData instanceData;
MeshData meshData;
uint32 cullingOffset;
Gfx::PBottomLevelAS rayTracingScene;
};
void resetMeshData();
+4
View File
@@ -122,6 +122,8 @@ void BufferAllocation::updateContents(uint64 regionOffset, uint64 regionSize, vo
cmd->bindResource(PBufferAllocation(this));
cmd->bindResource(PBufferAllocation(staging));
vkCmdCopyBuffer(cmd->getHandle(), staging->buffer, buffer, 1, &copy);
pipelineBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT);
// transferOwnership(prevOwner);
graphics->getDestructionManager()->queueResourceForDestruction(std::move(staging));
@@ -157,6 +159,8 @@ void BufferAllocation::readContents(uint64 regionOffset, uint64 regionSize, void
cmd->bindResource(PBufferAllocation(this));
cmd->bindResource(PBufferAllocation(staging));
vkCmdCopyBuffer(cmd->getHandle(), buffer, staging->buffer, 1, &copy);
pipelineBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT);
pool->submitCommands();
cmd->getFence()->wait(1000000);