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
This commit is contained in:
Brecht Van Lommel
2025-07-25 21:43:01 +02:00
committed by Brecht Van Lommel
parent c1ce72a8fc
commit fbfa4e3805

View File

@@ -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.";