Fix sporadic CUDA launch failures with Cycles viewport denoising

Sometimes the viewport buffer size is zero for a frame, which caused the denoising task to also try to
launch CUDA kernels with a launch size of zero, which in turn failed with a CUDA error. This patch
prevents launches from occuring in this case, similar to how it is handled in `copy_to_display_buffer`.
This commit is contained in:
Patrick Mours 2020-02-14 17:00:44 +01:00
parent e34ff4926f
commit 332aed6399
1 changed files with 4 additions and 0 deletions

View File

@ -1128,6 +1128,10 @@ void Session::denoise()
else {
assert(buffers);
if (tile_manager.state.buffer.width == 0 || tile_manager.state.buffer.height == 0) {
return; /* Avoid empty launches. */
}
/* Wait for rendering to finish. */
device->task_wait();