From 4527dd1ce4784292cd3b8dd3764b9cd843020f9a Mon Sep 17 00:00:00 2001 From: Jason Fielder Date: Fri, 1 Jul 2022 10:30:16 +0200 Subject: Metal: MTLMemoryManager implementation includes functions which manage allocation of MTLBuffer resources. The memory manager includes both a GPUContext-local manager which allocates per-context resources such as Circular Scratch Buffers for temporary data such as uniform updates and resource staging, and a GPUContext-global memory manager which features a pooled memory allocator for efficient re-use of resources, to reduce CPU-overhead of frequent memory allocations. These Memory Managers act as a simple interface for use by other Metal backend modules and to coordinate the lifetime of buffers, to ensure that GPU-resident resources are correctly tracked and freed when no longer in use. Note: This also contains dependent DIFF changes from D15027, though these will be removed once D15027 lands. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15277 --- source/blender/draw/engines/eevee/eevee_render.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/draw/engines/eevee') diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index bef19c589c2..82944f237ea 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -24,6 +24,7 @@ #include "DEG_depsgraph_query.h" #include "GPU_capabilities.h" +#include "GPU_context.h" #include "GPU_framebuffer.h" #include "GPU_state.h" @@ -646,6 +647,10 @@ void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl /* XXX Seems to fix TDR issue with NVidia drivers on linux. */ GPU_finish(); + /* Perform render step between samples to allow + * flushing of freed GPUBackend resources. */ + GPU_render_step(); + RE_engine_update_progress(engine, (float)(render_samples++) / (float)tot_sample); } } -- cgit v1.2.3