Hi Chris,
As it turns out, it is beneficial to draw on every frame (see results). You can see that when your version idles for a while, it will then jitter a bit when re-starting to draw.
More details on the results:
As in previous test, the experiment consists of a random dot pattern that moves for a while. This time, however, it moves for approx. 30sec (refreshRate()/2) and then does nothing for 30 seconds in the first break, 60s in the second break, 90s in the third break, etc… It does this for 30min.
The test setup has a 120Hz Samsung Screen which is connected to one of two Radeon HD 5770. Apart from that it doesn’t differ from the previously tested setups (which I haven’t tested with this test so far).
The no-gl-fence version
no warnings about lost frames
6 refreshes are completely lost (the bitcode is never recognized by the diode array)
announcement-diode lag between 8.22 and 32.1 ms
The patched no-gl-fence version
no warnings about lost frames
all refreshes are recognized by the diode-array
announcement-diode lag between 14.61 and 17.51 ms
** PATCH **
I’ve made some changes to the StimulusDisplay to avoid the jittery behavior. What I’ve done there is to let the stimuli draw on every frame, but let them only log their redraw whenever it was a needed draw action. It is now the stimulus responsibility to make sure that in a redundant draw call there will be nothing new on the screen, so that we’re not drawing something that won’t be logged.
For this purpose I’ve added the getNeedDraw() function to the stimulus display. Stimuli can now poll the stimulus display for the type of draw. If getNeedDraw returns false, a draw action will not be logged! It must therefore be ensured that the draw is exactly the same as in the previous one.
The necessary changes in the stimuli are pretty straight forward and I’ve modified the PointStimulus, the BasicTransformStimulus, the ImageStimulus and the Background already. (see diffs)
Unfortunately, this has to be done for ALL of the stimuli, and some of them are cleaner coded than others (e.g. some seem to still poll the datum objects when they announce, which is very dangerous imho).
What do you think?
Philipp