Project

General

Profile

« Previous | Next » 

Revision f80337b5

Added by Leszek Koltunski about 7 years ago

Revert "Some progress with Transform Feedback. Still many bugs all over."

This reverts commit 79921db22e4ff5a3b2e6e3466a39445f5607a695.

View differences:

src/main/java/org/distorted/library/EffectQueueVertex.java
45 45
  private static final int NUM_UNIFORMS = 12;
46 46
  private static final int NUM_CACHE    =  3;
47 47
  private static final int INDEX = EffectTypes.VERTEX.ordinal();
48
  private static int mNumEffectsH;
49
  private static int mTypeH;
50
  private static int mUniformsH;
48
  private static int[] mNumEffectsH = new int[DistortedEffects.NUM_PROGRAMS];
49
  private static int[] mTypeH       = new int[DistortedEffects.NUM_PROGRAMS];
50
  private static int[] mUniformsH   = new int[DistortedEffects.NUM_PROGRAMS];
51 51
  
52 52
///////////////////////////////////////////////////////////////////////////////////////////////////
53 53
   
......
58 58

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

  
61
  static void getUniforms(int mProgramH)
61
  static void getUniforms(int index, int mProgramH)
62 62
    {
63
    mNumEffectsH= GLES30.glGetUniformLocation( mProgramH, "vNumEffects");
64
    mTypeH      = GLES30.glGetUniformLocation( mProgramH, "vType");
65
    mUniformsH  = GLES30.glGetUniformLocation( mProgramH, "vUniforms");
63
    mNumEffectsH[index]= GLES30.glGetUniformLocation( mProgramH, "vNumEffects");
64
    mTypeH[index]      = GLES30.glGetUniformLocation( mProgramH, "vType");
65
    mUniformsH[index]  = GLES30.glGetUniformLocation( mProgramH, "vUniforms");
66 66
    }
67 67

  
68 68
///////////////////////////////////////////////////////////////////////////////////////////////////
......
133 133
   
134 134
///////////////////////////////////////////////////////////////////////////////////////////////////
135 135

  
136
  synchronized void send(float halfX, float halfY, float halfZ)
136
  synchronized void send(int index, float halfX, float halfY, float halfZ)
137 137
    {
138
    GLES30.glUniform1i( mNumEffectsH, mNumEffects);
138
    GLES30.glUniform1i( mNumEffectsH[index], mNumEffects);
139 139
      
140 140
    if( mNumEffects>0 )
141 141
      {
......
146 146
        mUniforms[NUM_UNIFORMS*i+7] = mCache[NUM_CACHE*i+2]-halfZ;
147 147
        }
148 148

  
149
      GLES30.glUniform1iv( mTypeH    ,                 mNumEffects, mName    ,0);
150
      GLES30.glUniform4fv( mUniformsH,(NUM_UNIFORMS/4)*mNumEffects, mUniforms,0);
149
      GLES30.glUniform1iv( mTypeH[index]    ,                 mNumEffects, mName    ,0);
150
      GLES30.glUniform4fv( mUniformsH[index],(NUM_UNIFORMS/4)*mNumEffects, mUniforms,0);
151 151
      }
152 152
    }
153 153

  
154 154
///////////////////////////////////////////////////////////////////////////////////////////////////
155 155

  
156
  synchronized void sendZero()
156
  synchronized void sendZero(int index)
157 157
    {
158
    GLES30.glUniform1i( mNumEffectsH, 0);
158
    GLES30.glUniform1i( mNumEffectsH[index], 0);
159 159
    }
160 160

  
161 161
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff