From 5e37f70307bdacedd0f7da65f8b385bc1426f21d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 7 Dec 2021 18:50:48 +0100 Subject: Fix T93350: Cycles renders shows black during rendering huge resolutions The root of the issue is caused by Cycles ignoring OpenGL limitation on the maximum resolution of textures: Cycles was allocating texture of the final render resolution. It was exceeding limitation on certain GPUs and driver. The idea is simple: use multiple textures for the display, each of which will fit into OpenGL limitations. There is some code which allows the display driver to know when to start the new tile. Also added some code to allow force graphics interop to be re-created. The latter one ended up not used in the final version of the patch, but it might be helpful for other drivers implementation. The tile size is limited to 8K now as it is the safest size for textures on many GPUs and OpenGL drivers. Differential Revision: https://developer.blender.org/D13385 --- intern/cycles/device/cuda/graphics_interop.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'intern/cycles/device') diff --git a/intern/cycles/device/cuda/graphics_interop.cpp b/intern/cycles/device/cuda/graphics_interop.cpp index 30efefd9b6b..c75d7957460 100644 --- a/intern/cycles/device/cuda/graphics_interop.cpp +++ b/intern/cycles/device/cuda/graphics_interop.cpp @@ -45,8 +45,10 @@ void CUDADeviceGraphicsInterop::set_display_interop( need_clear_ = display_interop.need_clear; - if (opengl_pbo_id_ == display_interop.opengl_pbo_id && buffer_area_ == new_buffer_area) { - return; + if (!display_interop.need_recreate) { + if (opengl_pbo_id_ == display_interop.opengl_pbo_id && buffer_area_ == new_buffer_area) { + return; + } } CUDAContextScope scope(device_); -- cgit v1.2.3