Project

General

Profile

« Previous | Next » 

Revision 8a57da61

Added by Leszek Koltunski about 6 years ago

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.

View differences:

src/main/java/org/distorted/library/main/DistortedOutputSurface.java
114 114

  
115 115
  private int mSurfaceID;
116 116
  private int mLastIndex;
117
  private int mLastValue =-1;
117 118
  // end section
118 119
  ////////////////////////////////////////////////////////////////////////////////
119 120

  
......
209 210

  
210 211
///////////////////////////////////////////////////////////////////////////////////////////////////
211 212

  
212
  void debugSSBO()
213
  int getNewCounter()
213 214
    {
214
    android.util.Log.d("SSBO", mIntBuffer.get(0)+" "+mIntBuffer.get(1)+" "
215
        +mIntBuffer.get(2)+" "+mIntBuffer.get(3) );
216
    }
217

  
218
///////////////////////////////////////////////////////////////////////////////////////////////////
219

  
220
  int resetNewCounter()
221
    {
222
    mIntBuffer.put(BUFFERING*mSurfaceID+mLastIndex,0);
223
    return BUFFERING*mSurfaceID + mLastIndex;
224
    }
215
    int value = mIntBuffer.get(BUFFERING*mSurfaceID+mLastIndex);
225 216

  
226
///////////////////////////////////////////////////////////////////////////////////////////////////
227

  
228
  int returnOldCounter()
229
    {
230
    int ret = mIntBuffer.get(BUFFERING*mSurfaceID+mLastIndex);
217
    if( value!=mLastValue )
218
      {
219
      mLastValue = value;
220
      android.util.Log.d("surface", "surface id: "+mSurfaceID+" value now: "+mLastValue);
221
      }
231 222

  
232 223
    mLastIndex++;
233 224
    if( mLastIndex>=BUFFERING ) mLastIndex-=BUFFERING;
234 225

  
235
    return ret;
226
    mIntBuffer.put(BUFFERING*mSurfaceID+mLastIndex,0);
227
    return BUFFERING*mSurfaceID + mLastIndex;
236 228
    }
237 229

  
238 230
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff