Project

General

Profile

« Previous | Next » 

Revision 586b5fa1

Added by Leszek Koltunski almost 6 years ago

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.

View differences:

src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
140 140
 *
141 141
 * @y.exclude
142 142
 */
143
  public int apply(float[] uniforms, int index, DistortedOutputSurface[] buffers)
143
  public int apply(float[] uniforms, int index, DistortedOutputSurface[] buffers, int fbo)
144 144
    {
145 145
    if( mProgram1 ==null)
146 146
      {
......
159 159

  
160 160
    DistortedFramebuffer buffer = (DistortedFramebuffer)buffers[mQualityLevel];
161 161

  
162
    buffer.setAsOutput();
162
    buffer.setAsOutputFBO(fbo);
163 163

  
164 164
    float w= buffer.getWidth();
165 165
    float h= buffer.getHeight();
......
182 182
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]*offsetCorrW;
183 183

  
184 184
    mProgram1.useProgram();
185
    buffer.bindForOutput(1);
186
    buffer.setAsInput(0);
185
    buffer.bindForOutput(2*fbo+1);
186
    buffer.setAsInput(2*fbo);
187 187

  
188 188
    GLES31.glColorMask(true,true,true,true);
189 189
    GLES31.glClearColor(1.0f,1.0f,1.0f,0.0f);
......
203 203
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]*offsetCorrH;
204 204

  
205 205
    mProgram2.useProgram();
206
    buffer.bindForOutput(0);
207
    buffer.setAsInput(1);
206
    buffer.bindForOutput(2*fbo);
207
    buffer.setAsInput(2*fbo+1);
208 208

  
209 209
    GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT);
210 210

  

Also available in: Unified diff