Optimize GPU textures and buffers uploads with a batched memory barrier
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "Engine/Content/Content.h"
|
||||
#include "Engine/Graphics/GPUContext.h"
|
||||
#include "Engine/Graphics/GPUDevice.h"
|
||||
#include "Engine/Graphics/GPUPass.h"
|
||||
#include "Engine/Graphics/RenderTask.h"
|
||||
#include "Engine/Graphics/RenderBuffers.h"
|
||||
#include "Engine/Graphics/RenderTargetPool.h"
|
||||
@@ -939,6 +940,7 @@ bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* co
|
||||
// Send objects data to the GPU
|
||||
{
|
||||
PROFILE_GPU_CPU_NAMED("Update Objects");
|
||||
GPUMemoryPass pass(context);
|
||||
surfaceAtlasData.ObjectsBuffer.Flush(context);
|
||||
surfaceAtlasData.ObjectsListBuffer.Flush(context);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Renderer.h"
|
||||
#include "Engine/Graphics/GPUContext.h"
|
||||
#include "Engine/Graphics/GPUPass.h"
|
||||
#include "Engine/Graphics/RenderTargetPool.h"
|
||||
#include "Engine/Graphics/RenderBuffers.h"
|
||||
#include "Engine/Graphics/RenderTask.h"
|
||||
@@ -523,6 +524,7 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext, RenderCont
|
||||
JobSystem::Wait(buildObjectsBufferJob);
|
||||
{
|
||||
PROFILE_CPU_NAMED("FlushObjectsBuffer");
|
||||
GPUMemoryPass pass(context);
|
||||
for (auto& e : renderContextBatch.Contexts)
|
||||
e.List->ObjectBuffer.Flush(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user