Compositor: Enable lock-free GPU context activation on macOS

This required to apply a small fix in the Metal texture uploader.

Without synchronization pixels of a wrong pass can be uploaded to
a wrong texture. This is because this code path is heavily reusing
temporary allocations, and at some point the allocation is not
considered as still in use, unless the command buffer used by the
texture uploader is submitted.

Ref #118919

Pull Request: https://projects.blender.org/blender/blender/pulls/118920
This commit is contained in:
Sergey Sharybin
2024-03-01 14:38:09 +01:00
committed by Sergey Sharybin
parent c3d3528280
commit 3fcd7ccbc0
2 changed files with 2 additions and 14 deletions

View File

@@ -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.
*/