Project

General

Profile

« Previous | Next » 

Revision 8ebbc730

Added by Leszek Koltunski almost 6 years ago

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.

Still some TODOs in DistortedFramebuffer remain (properly check for Framebuffer completness!)

View differences:

src/main/java/org/distorted/library/main/DistortedSurface.java
25 25
{
26 26
  int mColorCreated;
27 27
  int mNumColors;
28
  int mNumFBOs;
28 29
  int[] mColorH;
29 30
  int mWidth, mHeight;
30 31

  
31 32
///////////////////////////////////////////////////////////////////////////////////////////////////
32 33

  
33
  DistortedSurface(int width, int height, int create, int numcolors, int type)
34
  DistortedSurface(int width, int height, int create, int numfbos, int numcolors, int type)
34 35
    {
35 36
    super(create,type);
36 37

  
38
    mNumFBOs      = numfbos;
37 39
    mNumColors    = numcolors;
38 40
    mWidth        = width ;
39 41
    mHeight       = height;
40 42
    mColorCreated = create;
41 43

  
42
    if( mNumColors>0 )
44
    int total = mNumFBOs*mNumColors;
45

  
46
    if( total>0 )
43 47
      {
44
      mColorH = new int[mNumColors];
45
      for( int i=0; i<mNumColors; i++ )  mColorH[i] = 0;
48
      mColorH = new int[total];
49
      for( int i=0; i<total; i++ )  mColorH[i] = 0;
46 50
      }
47 51
    }
48 52

  

Also available in: Unified diff