commit 97b6c85e61d0e7f46cf5681d1daa2306b1a33b22
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Feb 23 22:54:02 2021 +0100

    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.

diff --git a/src/main/java/org/distorted/library/effect/EffectType.java b/src/main/java/org/distorted/library/effect/EffectType.java
index 2341437..ea8493f 100644
--- a/src/main/java/org/distorted/library/effect/EffectType.java
+++ b/src/main/java/org/distorted/library/effect/EffectType.java
@@ -74,7 +74,7 @@ public enum EffectType
     maxtable[0] =100;  // By default, there can be a maximum 100 MATRIX effects in a single
                        // EffectQueueMatrix at any given time. This can be changed with a call
                        // to EffectQueueMatrix.setMax(int)
-    maxtable[1] =100;  // Max 100 VERTEX Effects
+    maxtable[1] = 30;  // Max 30 VERTEX Effects
     maxtable[2] =  5;  // Max 5 FRAGMENT Effects
     maxtable[3] =  3;  // Max 3 POSTPROCESSING Effects
     }
diff --git a/src/main/java/org/distorted/library/main/DistortedLibrary.java b/src/main/java/org/distorted/library/main/DistortedLibrary.java
index 979aea2..88afb4a 100644
--- a/src/main/java/org/distorted/library/main/DistortedLibrary.java
+++ b/src/main/java/org/distorted/library/main/DistortedLibrary.java
@@ -116,6 +116,7 @@ public class DistortedLibrary
   private static int mGLSL;
   private static String mGLSL_VERSION;
   private static boolean mOITCompilationAttempted;
+  private static boolean mNeedsTransformFeedback;
 
   private static int mMaxTextureSize         = Integer.MAX_VALUE;
   private static int mMaxNumberOfVerUniforms = Integer.MAX_VALUE;
@@ -255,8 +256,9 @@ public class DistortedLibrary
 
     try
       {
-      mMainProgram = new DistortedProgram(mainVertStream, mainFragStream, mainVertHeader, mainFragHeader,
-                                          enabledEffectV, enabledEffectF, mGLSL, feedback);
+      mMainProgram = new DistortedProgram(mainVertStream, mainFragStream, mainVertHeader,
+                                          mainFragHeader, enabledEffectV, enabledEffectF,
+                                          mGLSL, mNeedsTransformFeedback ? feedback : null );
       }
     catch(Exception e)
       {
@@ -926,6 +928,13 @@ public class DistortedLibrary
         Log.e("DISTORTED", "GLSL Version "+GLES30.glGetString(GLES31.GL_SHADING_LANGUAGE_VERSION));
         }
       }
+    else if( vendor.contains("Qualcomm"))
+      {
+      if( version.contains("V@331.0") )
+        {
+        Log.e("DISTORTED", "You are running this on an Adreno 3xx driver version 331.\nStrange shit might happen.");
+        }
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1164,6 +1173,15 @@ public class DistortedLibrary
     return mMaxTextureSize;
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * Call this before calling onSurfaceCreated() if you want to access normal vectors in CPU.
+ */
+  public static void needTransformFeedback()
+    {
+    mNeedsTransformFeedback = true;
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Returns the maximum number of effects of a given type that can be simultaneously applied to a
diff --git a/src/main/java/org/distorted/library/mesh/MeshBase.java b/src/main/java/org/distorted/library/mesh/MeshBase.java
index 0c910e0..a5b773f 100644
--- a/src/main/java/org/distorted/library/mesh/MeshBase.java
+++ b/src/main/java/org/distorted/library/mesh/MeshBase.java
@@ -51,7 +51,7 @@ public abstract class MeshBase
    {
    private static final int ASSOC_UBO_BINDING  = 3;
    private static final int CENTER_UBO_BINDING = 4;
-   public  static final int MAX_EFFECT_COMPONENTS= 250;
+   public  static final int MAX_EFFECT_COMPONENTS= 100;
 
    // sizes of attributes of an individual vertex.
    private static final int POS_DATA_SIZE= 3; // vertex coordinates: x,y,z
