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/PostprocessEffectGlow.java
144 144
 *
145 145
 * @y.exclude
146 146
 */
147
  public int apply(float[] uniforms, int index, DistortedOutputSurface[] buffers)
147
  public int apply(float[] uniforms, int index, DistortedOutputSurface[] buffers, int fbo)
148 148
    {
149 149
    if( mProgram1 ==null)
150 150
      {
......
180 180
    int offset = radius + radius*radius/4;
181 181
    radius = (radius+1)/2;
182 182

  
183
    outBuffer.setAsOutput();
183
    outBuffer.setAsOutputFBO(fbo);
184 184
    GLES31.glViewport(0, 0, (int)w, (int)h);
185 185

  
186 186
    // horizontal glow
187 187
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]*offsetCorrW;
188 188

  
189 189
    mProgram1.useProgram();
190
    outBuffer.bindForOutput(1);
191
    inBuffer.setAsInput(0);
190
    outBuffer.bindForOutput(2*fbo+1);
191
    inBuffer.setAsInput(2*fbo);
192 192

  
193 193
    GLES31.glColorMask(true,true,true,true);
194 194
    GLES31.glClearColor(1.0f,1.0f,1.0f,0.0f);
......
209 209
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]*offsetCorrH;
210 210

  
211 211
    mProgram2.useProgram();
212
    outBuffer.bindForOutput(0);
213
    outBuffer.setAsInput(1);
212
    outBuffer.bindForOutput(2*fbo);
213
    outBuffer.setAsInput(2*fbo+1);
214 214

  
215 215
    GLES31.glUniform1f ( mProgram2.mUniform[0] , n );
216 216
    GLES31.glUniform2f ( mProgram2.mUniform[1] , corrW, corrH );

Also available in: Unified diff