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/EffectQueueVertex.java
31 31
  { 
32 32
  private static final int NUM_UNIFORMS = VertexEffect.NUM_UNIFORMS;
33 33
  private static final int INDEX = EffectType.VERTEX.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
  EffectQueueVertex(long id)
......
51 56
    mUniformsH  = GLES31.glGetUniformLocation( mProgramH, "vUniforms");
52 57
    }
53 58

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

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

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

  
114
///////////////////////////////////////////////////////////////////////////////////////////////////
115

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

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

Also available in: Unified diff