Project

General

Profile

« Previous | Next » 

Revision c1a38ba3

Added by Leszek Koltunski almost 6 years ago

Progress with non-postprocessed OIT.

Status: compiles, but fails to work on both Adreno and Mali. Crashes the app (Adreno) or the whole system (Mali)

View differences:

src/main/java/org/distorted/library/main/EffectQueueFragment.java
31 31
  {
32 32
  private static final int NUM_UNIFORMS = FragmentEffect.NUM_UNIFORMS;
33 33
  private static final int INDEX = EffectType.FRAGMENT.ordinal();
34

  
34 35
  private static int mNumEffectsH;
35 36
  private static int mNameH;
36 37
  private static int mUniformsH;
37
  
38

  
39
  private static int mNumEffectsOITH;
40
  private static int mNameOITH;
41
  private static int mUniformsOITH;
42

  
38 43
///////////////////////////////////////////////////////////////////////////////////////////////////
39 44
   
40 45
  EffectQueueFragment(long id)
......
51 56
    mUniformsH  = GLES31.glGetUniformLocation( mProgramH, "fUniforms");
52 57
    }
53 58

  
59
///////////////////////////////////////////////////////////////////////////////////////////////////
60

  
61
  static void getUniformsOIT(int mProgramH)
62
    {
63
    mNumEffectsOITH= GLES31.glGetUniformLocation( mProgramH, "fNumEffects");
64
    mNameOITH      = GLES31.glGetUniformLocation( mProgramH, "fName");
65
    mUniformsOITH  = GLES31.glGetUniformLocation( mProgramH, "fUniforms");
66
    }
67

  
54 68
///////////////////////////////////////////////////////////////////////////////////////////////////
55 69
  
56 70
  void compute(long currTime,float halfX, float halfY)
......
95 109
      GLES31.glUniform4fv( mUniformsH,(NUM_UNIFORMS/4)*mNumEffects, mUniforms,0);
96 110
      }  
97 111
    }
112

  
113
///////////////////////////////////////////////////////////////////////////////////////////////////
114

  
115
  void sendOIT()
116
    {
117
    GLES31.glUniform1i( mNumEffectsOITH, mNumEffects);
118

  
119
    if( mNumEffects>0 )
120
      {
121
      GLES31.glUniform1iv( mNameOITH    ,                 mNumEffects, mName    ,0);
122
      GLES31.glUniform4fv( mUniformsOITH,(NUM_UNIFORMS/4)*mNumEffects, mUniforms,0);
123
      }
124
    }
98 125
  }

Also available in: Unified diff