diff --git a/source/blender/gpu/metal/mtl_texture.mm b/source/blender/gpu/metal/mtl_texture.mm index ee14026bd5b..08097e81e70 100644 --- a/source/blender/gpu/metal/mtl_texture.mm +++ b/source/blender/gpu/metal/mtl_texture.mm @@ -1122,6 +1122,8 @@ void gpu::MTLTexture::update_sub( /* Decrement texture reference counts. This ensures temporary texture views are released. */ [texture_handle release]; + ctx->main_command_buffer.submit(false); + /* Release temporary staging buffer allocation. * NOTE: Allocation will be tracked with command submission and released once no longer in use. */ diff --git a/source/blender/render/intern/compositor.cc b/source/blender/render/intern/compositor.cc index 0c4bf9b01c3..662b6082112 100644 --- a/source/blender/render/intern/compositor.cc +++ b/source/blender/render/intern/compositor.cc @@ -508,13 +508,6 @@ class RealtimeCompositor { * to avoid them blocking each other. */ BLI_assert(!BLI_thread_is_main() || G.background); - /* The realtime compositor uses GPU module and does not rely on the draw manager, or its global - * state. This means that activation of GPU context does not require lock of the main thread. - * - * However, while this has been tested on Linux and works well, on macOS it causes to - * spontaneous invalid colors in the composite output. The Windows has not been extensively - * tested yet. */ -#if defined(__linux__) || defined(_WIN32) if (G.background) { /* In the background mode the system context of the render engine might be nullptr, which * forces some code paths which more tightly couple it with the draw manager. @@ -529,9 +522,6 @@ class RealtimeCompositor { GPU_render_begin(); WM_system_gpu_context_activate(re_system_gpu_context); GPU_context_active_set(static_cast(re_blender_gpu_context)); -#else - DRW_render_context_enable(&render_); -#endif context_->update_input_data(input_data); @@ -546,14 +536,10 @@ class RealtimeCompositor { context_->viewer_output_to_viewer_image(); texture_pool_->free_unused_and_reset(); -#if defined(__linux__) || defined(_WIN32) GPU_flush(); GPU_render_end(); GPU_context_active_set(nullptr); WM_system_gpu_context_release(re_system_gpu_context); -#else - DRW_render_context_disable(&render_); -#endif } };