Cycles-X: Change viewport update system to be time based rather than sample based on fast devices
The viewport update speed when rendering with infinite samples has been changed to work based primarily on time since render start rather than sample count.
This change has been made because if you have a device fast enough to exceed 32 samples in 0.1 seconds, then the next viewport update you'll observe is 2 seconds after `render start` which can be annoying for anyone wishing to quickly iterate on fine details as `render start` is usually a 1 sample per pixel image meaning fine detail is lost in noise or overly blurred by a denoiser.
This change was made possible with help from Will Rusthon (a friend) and Blender developers.
Here is an example video of the issue (some of the "viewport changes" you see are due to compression artifacts to keep the video small):
And here is my fix tested (the second demo with the caustics is there to show that the viewport updates reduce as time goes on. It's easier to see in the caustics scene due to the fireflies. This is important because reduced viewpoint updates means faster ray tracing. The difference is that with this patch the slow viewport update (once every 2 seconds) has been moved to after rendering for 8 seconds rather than occurring at 32 samples which could happen really quickly with simplistic scenes. Also the denoiser stopping at the end of the video has been fixed and is currently in the patch available for review):
Reviewed By: sergey, leesonw
Differential Revision: https://developer.blender.org/D12265