Put all the pipeline barriers in the same function and use a new instance buffer each time the TLAS is updated

This commit is contained in:
Magnus Norddahl 2023-12-26 04:30:11 +01:00
commit c1f38b18c4
4 changed files with 102 additions and 99 deletions

View file

@ -482,7 +482,7 @@ void VulkanRenderDevice::BeginFrame()
levelMeshChanged = false;
mLevelMesh->SetLevelMesh(levelMesh);
if (levelMesh && levelMesh->StaticMesh->GetSurfaceCount() > 0)
if (levelMesh && levelMesh->StaticMesh->LMTextureCount > 0)
{
GetTextureManager()->CreateLightmap(levelMesh->StaticMesh->LMTextureSize, levelMesh->StaticMesh->LMTextureCount, std::move(levelMesh->StaticMesh->LMTextureData));
GetLightmapper()->SetLevelMesh(levelMesh);
@ -491,12 +491,12 @@ void VulkanRenderDevice::BeginFrame()
SetViewportRects(nullptr);
mCommands->BeginFrame();
mLevelMesh->BeginFrame();
mTextureManager->BeginFrame();
mScreenBuffers->BeginFrame(screen->mScreenViewport.width, screen->mScreenViewport.height, screen->mSceneViewport.width, screen->mSceneViewport.height);
mSaveBuffers->BeginFrame(SAVEPICWIDTH, SAVEPICHEIGHT, SAVEPICWIDTH, SAVEPICHEIGHT);
mRenderState->BeginFrame();
mDescriptorSetManager->BeginFrame();
mLevelMesh->BeginFrame();
mLightmapper->BeginFrame();
}