From fbfa4e3805c705d1505ba31396e7a6e23e017516 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 25 Jul 2025 21:43:01 +0200 Subject: [PATCH] Fix #143128: Cycles crash or artifacts with multi device rendering and denoising Clear graphics interop when mapping the buffer directly, as this might free the underlying buffer or handle. Fix #141736: Artifacts on Vulkan GPU + GPU Fix #143128: Crash on Metal CPU + GPU Pull Request: https://projects.blender.org/blender/blender/pulls/143243 --- intern/cycles/blender/display_driver.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/intern/cycles/blender/display_driver.cpp b/intern/cycles/blender/display_driver.cpp index e78f8c3df33..e5decb3936f 100644 --- a/intern/cycles/blender/display_driver.cpp +++ b/intern/cycles/blender/display_driver.cpp @@ -606,6 +606,14 @@ void BlenderDisplayDriver::update_end() half4 *BlenderDisplayDriver::map_texture_buffer() { + /* With multi device rendering, Cycles can switch between using graphics interop + * and not. For the denoised image it may be able to use graphics interop as that + * buffer is written to by one device, while the noisy renders can not use it. + * + * We need to clear the graphics interop buffer on that switch, as GPU_pixel_buffer_map + * may recreate the buffer or handle. */ + graphics_interop_buffer_.clear(); + GPUPixelBuffer *pix_buf = tiles_->current_tile.buffer_object.gpu_pixel_buffer; if (!DCHECK_NOTNULL(pix_buf)) { LOG_ERROR << "Display driver tile pixel buffer unavailable.";