Fixing some stuff
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -51,6 +51,7 @@ class VertexData {
|
||||
Vector worldPosition;
|
||||
InstanceData instanceData;
|
||||
MeshData meshData;
|
||||
uint32 cullingOffset;
|
||||
Gfx::PBottomLevelAS rayTracingScene;
|
||||
};
|
||||
void resetMeshData();
|
||||
|
||||
@@ -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, ©);
|
||||
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, ©);
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user