From 9130a60d3d833718c932d3f971b746ba253734bc Mon Sep 17 00:00:00 2001 From: Jason Fielder Date: Mon, 27 Jun 2022 11:41:04 +0200 Subject: MTLCommandBufferState for coordinating GPU workload submission and render pass coordination. MTLFrameBuffer has been implemented to support creation of RenderCommandEncoders, along with supporting functionality in the Metal Context. Optimisation stubs for GPU_framebuffer_bind_ext has been added, which enables specific assignment of attachment load-store ops at the bind level, rather than on a framebuffer object as a whole. Begin and end frame markers are used to encapsulate frame boundaries for explicit workload submission. This is required for explicit APIs where implicit flushing of work does not occur. Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15027 --- source/blender/gpu/GPU_context.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/gpu/GPU_context.h') diff --git a/source/blender/gpu/GPU_context.h b/source/blender/gpu/GPU_context.h index f3b7f8c29bf..1fcd94c48fc 100644 --- a/source/blender/gpu/GPU_context.h +++ b/source/blender/gpu/GPU_context.h @@ -38,6 +38,13 @@ void GPU_context_discard(GPUContext *); void GPU_context_active_set(GPUContext *); GPUContext *GPU_context_active_get(void); +/* Begin and end frame are used to mark the singular boundary representing the lifetime of a whole + * frame. This also acts as a divisor for ensuring workload submission and flushing, especially for + * background rendering when there is no call to present. + * This is required by explicit-API's where there is no implicit workload flushing. */ +void GPU_context_begin_frame(GPUContext *ctx); +void GPU_context_end_frame(GPUContext *ctx); + /* Legacy GPU (Intel HD4000 series) do not support sharing GPU objects between GPU * contexts. EEVEE/Workbench can create different contexts for image/preview rendering, baking or * compiling. When a legacy GPU is detected (`GPU_use_main_context_workaround()`) any worker -- cgit v1.2.3