Project

General

Profile

« Previous | Next » 

Revision 5f35f1cb

Added by Leszek Koltunski almost 4 years ago

Only insert the 'Mali r12' FBO queue fix if we actually are running on a Mali GPU with driver version <22. (then FBOQueue=4 - unless we manually overide this down to 1 - else, always 1)

View differences:

src/main/java/org/distorted/library/main/InternalOutputSurface.java
43 43
  static final float DEFAULT_NEAR=  0.1f;
44 44

  
45 45
  private float mFOV;
46
  private int mTmpFBO;
46 47

  
47 48
  private long[] mTime;
48 49
  private float mClearR, mClearG, mClearB, mClearA, mClearDepth;
......
71 72
    mRenderWayOIT = false;
72 73
    mCurrFBO      = 0;
73 74

  
74
    mDepthStencilH = new int[numfbos];
75
    mFBOH          = new int[numfbos];
76

  
77
    mTime = new long[numfbos];
78
    for(int i=0; i<mNumFBOs;i++) mTime[i]=0;
79

  
80 75
    mRealWidth = mWidth = width;
81 76
    mRealHeight= mHeight= height;
82 77

  
......
88 83
    mDepthStencilCreated= (depthStencil== NO_DEPTH_NO_STENCIL ? DONT_CREATE:NOT_CREATED_YET);
89 84
    mDepthStencil = depthStencil;
90 85

  
91
    mFBOH[0]         = fbo;
92
    mDepthStencilH[0]= 0;
93

  
94 86
    mClearR = 0.0f;
95 87
    mClearG = 0.0f;
96 88
    mClearB = 0.0f;
......
104 96

  
105 97
    mChildren = new InternalChildrenList(this);
106 98

  
99
    mTmpFBO = fbo;
100

  
101
    allocateStuffDependantOnNumFBOS();
107 102
    createProjection();
108 103
    }
109 104

  
105
///////////////////////////////////////////////////////////////////////////////////////////////////
106

  
107
  void allocateStuffDependantOnNumFBOS()
108
    {
109
    if( mNumFBOs>0 )
110
      {
111
      mDepthStencilH   = new int[mNumFBOs];
112
      mDepthStencilH[0]= 0;
113

  
114
      mFBOH   = new int[mNumFBOs];
115
      mFBOH[0]= mTmpFBO;
116

  
117
      mTime = new long[mNumFBOs];
118
      for(int i=0; i<mNumFBOs;i++) mTime[i]=0;
119
      }
120
    }
121

  
110 122
///////////////////////////////////////////////////////////////////////////////////////////////////
111 123

  
112 124
  private void createProjection()
......
156 168
    final float CLEAR_D = 1.0f;
157 169
    final int   CLEAR_S = 0;
158 170

  
171
    final int queueSize = DistortedLibrary.getQueueSize();
159 172
    float mipmap=1.0f;
160 173

  
161 174
    for (int j=0; j<quality; j++) mipmap *= EffectQuality.MULTIPLIER;
162 175

  
163
    mBuffer[quality] = new DistortedFramebuffer(DistortedLibrary.FBO_QUEUE_SIZE,2,BOTH_DEPTH_STENCIL,TYPE_SYST, (int)(width*mipmap), (int)(height*mipmap) );
176
    mBuffer[quality] = new DistortedFramebuffer(queueSize,2,BOTH_DEPTH_STENCIL,TYPE_SYST, (int)(width*mipmap), (int)(height*mipmap) );
164 177
    mBuffer[quality].mMipmap = mipmap;
165 178
    mBuffer[quality].mNear = near;  // copy mNear as well (for blitting- see PostprocessEffect.apply() )
166 179
    mBuffer[quality].glClearColor(CLEAR_R, CLEAR_G, CLEAR_B, CLEAR_A);
......
172 185
    GLES30.glClearDepthf(CLEAR_D);
173 186
    GLES30.glClearStencil(CLEAR_S);
174 187

  
175
    for(int k = 0; k< DistortedLibrary.FBO_QUEUE_SIZE; k++)
188
    for(int k=0; k<queueSize; k++)
176 189
      {
177 190
      GLES30.glBindFramebuffer(GLES30.GL_FRAMEBUFFER, mBuffer[quality].mFBOH[k]);
178 191
      GLES30.glFramebufferTexture2D(GLES30.GL_FRAMEBUFFER, GLES30.GL_COLOR_ATTACHMENT0, GLES30.GL_TEXTURE_2D, mBuffer[quality].mColorH[2*k+1], 0);

Also available in: Unified diff