Project

General

Profile

« Previous | Next » 

Revision 97b6c85e

Added by Leszek Koltunski almost 4 years ago

Bugfixes as a result of the Samsung Galaxy J4+ investigation:

1) By default, switch off transform feedback in the main program.
Create a new API 'needTransformFeedback()' to call if someone still needs TF in the main program.
2) lower the default max number of vertex effects to 30.
3) lower the default max number of Components of a Mesh to 100.

View differences:

src/main/java/org/distorted/library/effect/EffectType.java
74 74
    maxtable[0] =100;  // By default, there can be a maximum 100 MATRIX effects in a single
75 75
                       // EffectQueueMatrix at any given time. This can be changed with a call
76 76
                       // to EffectQueueMatrix.setMax(int)
77
    maxtable[1] =100;  // Max 100 VERTEX Effects
77
    maxtable[1] = 30;  // Max 30 VERTEX Effects
78 78
    maxtable[2] =  5;  // Max 5 FRAGMENT Effects
79 79
    maxtable[3] =  3;  // Max 3 POSTPROCESSING Effects
80 80
    }
src/main/java/org/distorted/library/main/DistortedLibrary.java
116 116
  private static int mGLSL;
117 117
  private static String mGLSL_VERSION;
118 118
  private static boolean mOITCompilationAttempted;
119
  private static boolean mNeedsTransformFeedback;
119 120

  
120 121
  private static int mMaxTextureSize         = Integer.MAX_VALUE;
121 122
  private static int mMaxNumberOfVerUniforms = Integer.MAX_VALUE;
......
255 256

  
256 257
    try
257 258
      {
258
      mMainProgram = new DistortedProgram(mainVertStream, mainFragStream, mainVertHeader, mainFragHeader,
259
                                          enabledEffectV, enabledEffectF, mGLSL, feedback);
259
      mMainProgram = new DistortedProgram(mainVertStream, mainFragStream, mainVertHeader,
260
                                          mainFragHeader, enabledEffectV, enabledEffectF,
261
                                          mGLSL, mNeedsTransformFeedback ? feedback : null );
260 262
      }
261 263
    catch(Exception e)
262 264
      {
......
926 928
        Log.e("DISTORTED", "GLSL Version "+GLES30.glGetString(GLES31.GL_SHADING_LANGUAGE_VERSION));
927 929
        }
928 930
      }
931
    else if( vendor.contains("Qualcomm"))
932
      {
933
      if( version.contains("V@331.0") )
934
        {
935
        Log.e("DISTORTED", "You are running this on an Adreno 3xx driver version 331.\nStrange shit might happen.");
936
        }
937
      }
929 938
    }
930 939

  
931 940
///////////////////////////////////////////////////////////////////////////////////////////////////
......
1164 1173
    return mMaxTextureSize;
1165 1174
    }
1166 1175

  
1176
///////////////////////////////////////////////////////////////////////////////////////////////////
1177
/**
1178
 * Call this before calling onSurfaceCreated() if you want to access normal vectors in CPU.
1179
 */
1180
  public static void needTransformFeedback()
1181
    {
1182
    mNeedsTransformFeedback = true;
1183
    }
1184

  
1167 1185
///////////////////////////////////////////////////////////////////////////////////////////////////
1168 1186
/**
1169 1187
 * Returns the maximum number of effects of a given type that can be simultaneously applied to a
src/main/java/org/distorted/library/mesh/MeshBase.java
51 51
   {
52 52
   private static final int ASSOC_UBO_BINDING  = 3;
53 53
   private static final int CENTER_UBO_BINDING = 4;
54
   public  static final int MAX_EFFECT_COMPONENTS= 250;
54
   public  static final int MAX_EFFECT_COMPONENTS= 100;
55 55

  
56 56
   // sizes of attributes of an individual vertex.
57 57
   private static final int POS_DATA_SIZE= 3; // vertex coordinates: x,y,z

Also available in: Unified diff