diff options
author | Jason Fielder <jason_apple> | 2022-07-01 11:30:16 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-07-01 11:31:57 +0300 |
commit | 4527dd1ce4784292cd3b8dd3764b9cd843020f9a (patch) | |
tree | 141a4252da1fbfdf825dd8fbafcd9fa7c644034f /source/blender/draw/engines/workbench | |
parent | 3ffc5583411ac6e1286586881bdbe1207a34b386 (diff) |
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
Diffstat (limited to 'source/blender/draw/engines/workbench')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_render.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_render.c b/source/blender/draw/engines/workbench/workbench_render.c index e5dcf6c5624..931f6a2dc92 100644 --- a/source/blender/draw/engines/workbench/workbench_render.c +++ b/source/blender/draw/engines/workbench/workbench_render.c @@ -17,6 +17,7 @@ #include "ED_view3d.h" +#include "GPU_context.h" #include "GPU_shader.h" #include "DEG_depsgraph.h" @@ -188,6 +189,10 @@ void workbench_render(void *ved, RenderEngine *engine, RenderLayer *render_layer workbench_draw_finish(data); + /* Perform render step between samples to allow + * flushing of freed GPUBackend resources. */ + GPU_render_step(); + /* Write render output. */ const char *viewname = RE_GetActiveRenderView(engine->re); RenderPass *rp = RE_pass_find_by_name(render_layer, RE_PASSNAME_COMBINED, viewname); |