I am pretty sure this time the flashing issues on Mali T880 r12 driver are finally fixed.
The fix: a queue of FBOs render to, just like before, but this time in DistortedScreen we blit not the current FBO, but the one computed several frames ago.
This of course introduces a delay and uses more memory, but it appears to work and does not seem to have any effects on speed.
Port another commit from master.
I spoke too soon, the ARM Mali flashing is of course not fixed yet. The previous commit fixed Triblur, but the bug is still reproducible elsewhere (only in the 'postprocessed' apps though).
This commit introduces a circular queue in case of the postprocessing FBOs - with little success though.
Port a commit from the master branch.
Finally properly fix the flashing on ARM Mali T880 GPU.
The flashing is caused by a 'full pipeline flush' (see DarkPhoton, https://www.opengl.org/discussion_boards/showthread.php/200754-Flashes-on-ARM-Mali?p=1291679&viewfull=1#post1291679 ). In order to combat it, first introduce the possibility that a single DistortedOutputSurface is backed up by more than one FBO. Then make DistortedScreen be derived from DistortedFramebuffer (which itself is derived from DistortedOutputSurface) and make it contain 3 FBOs, render to them in a circular queue fashion, and blit from a given FBO to the system FBO. The 'more than 1 intermediate FBO' queue prevents the pipeline flush....
Revert last changes to the postprocessing FBO.
This reverts commit 2dbed690bdbee80d9bfb22c800073855eb5d0946.
Try and avoid re-sorting the children by buckets (if we can!). This makes change in rendering order in the 'Transparency' app actually work.
In an attempt to contain the flashes on Mali GPU, re-structure the post-processing FBOs from 1 FBO with 2 color attachments + combined depth-stencil to 2 separate FBOs sharing a depth-stencil texture.
Result: this appears to make the flashes slightly worse.
Minor
OIT: fixes for Mali: fix a broken loop in the oitRender fragment shader that resulted in flashing.
OIT: fix for 'out of memory' crash on Mali GPUs.
~The thing still does not fully work there - there are still strange flashes in apps that innvolve OIT, for example in 'Triblur'.
OIT: more fixes
OIT: fixes. Everything looks correct now except for the curious return of the 'dancing lower-left corner' small glitch in the 'Transparency' app.
OIT: move towards 4 passes ( clear - build - collapse - render )
correct oitRender again: we need to disable stencil reading and writing and restore after
correct oitRenddr again; correct coming to paused state (we could crash)
Make sure we don't create a feedback loop in oitRender
Make us read only the DEPTH part of a DEPTH24_STENCIL8 attachment.
Reengineer DistortedScreen
Postprocessing: dont crash when we fail to compile postprocessing programs
OIT: some progress
OIT: more bugfixes
OIT: lots of progress on all fronts. Still a few bugs to solve though!
OIT: clear the postprocessing buffer with transparent white.
Properly recreate the Atomic and LinkedList buffers onPause.We have to discard all alpha==0.0 pixels during OIT Pass1.
small correction for blending OIT colors.
minor.
OIT: something starts working ('Blur' and 'Multiblur' work, 'Triblur' and 'Transparency' do not)
Fix the 'OIT' artefacts.
still debugging the OIT
- remove counting of transparent pixels from main fragment shader- remove debugs and tidy up- some fixes for the Mali GPU
Order Independent Transparency: debugging
Order Independent Transparency: some progress
Order Independent Transparency. Does not work yet.
Disable blending during postprocessing.
Fix for bug #28: looks of the borders of a blurred object depend on if the object is the first in the postprocessing bucket.
Postprocessing buffers mBuffer[] are now shared among all postprocessing operations. This saves a lot of memory, but also means that when doing each particular postprocessing, the textures backing up the mBuffer might be too large. We need to fix two things here: when outputting to those too large textures, we need to adjust the Viewport, and when binding those too large textures as input - we need to adjust the TexCoords to compensate....
Improve the 'PostprocessTree' app. Shows bugs in postprocessing.
Simplify postprocessing buffers.
Make the postprocessing buffers static.
A little progress making the postprocessing buffers static.
Introduce possibility that an OutputSurface is backed up by a larger texture than necessary and the 'cloneSize()' method.
Improve Blur (boundaries should be more white than black)
New 'Triblur' testapp.
Shows that the Blur effect doesn't fully work (probably it is the 'blitWithDepth' function which needs to be corrected)
SSBO: now we have a more-or-less correct running average of the count of transparent fragments over the last few frames.
SSBO: correct various things.
SSBO: zero out the per-surface transparent fragment counter only when setting the surface as output for the first time in the frame.
SSBO: handle the fact that we might run out of space in our SSBO if we keep creating new Surfaces.
SSBO: counting of transparent fragments more or less works now. Still the counters are zeroed out in the wrong place - every time we start rendering something to a given Surface, rather than once per frame.
SSBO: more and more works...
SSBO: fix problems with endianness.
SSBO: something is working already, although we still get the 4 bytes back from the shader in reverse order ( so '17'=0x00000011 written by the shader becomes '285212672 = 0x11000000' )
First try at the SSBO (doesn't work - reads in the application don't pick up changes in the shader; crashes.
Up library requirements to OpenGL ES 3.1 (needed for the upcoming GL_SHADER_STORAGE_BUFFER)
New Object Counter class - to count OutputSurfaces lazy way, but keep the counters small (reuse)
Remove debugging.
Initialize MessageSender even if compiling some of the programs fails.
Internal API change around postprocessing.
Minor.
1) Fix for the last fix in Framebuffer2) in RenderState, reset everything to a known state (rather than mark as unknown)
Fix in Framebuffer
Empty change (add commented out code)
Bugfix in RenderState
Bugfix (bug visible in 'Olimpic': when we make the last moving circle invisible, to used to stay visible!)'
Fix quality levels in Glow.
Debugging Glow.
Progress with Glow.
Bugfix in calculating blur offsets.
Simplify Statics.
Some progress with GLOW. Still does not look right :)
Introduce concepts of 'in' and 'out' postprocessing qualities.
Make Postprocessing quality per-effect (rather than applied to the whole queue)
Javadoc.
make RenderState package-local.
move EffectQuality to the effect package.
Fixes for dynamic postprocessing.
Now all PostprocessEffects are truly self-contained, including dynamic enable() and all shader sources.
Simplification in PostprocessEffects
Correction for the last change.
Postprocessing: take quality only from the first child in a bucket.
Simplification in EffectQueueMatrix.
Prevent possibility to enable an effect multiple times.
Now all Postprocessing EffectQueues have the right IDs regardless of number of effects.
Move all the knowledge about Vertex and Fragment effects to their respective classes.
All knowledge about Postporcessing moved to the respective Effect classes.
Move all knowledge about a MatrixEffect from the EffectQueueMatrix to the classes.
Simplify Effect classes.