commit b4a9a34f88c206e8b401ee5aac16294a5c264352
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sun Mar 14 10:04:48 2021 +0100

    Properly solve the issue with Qualcomm driver V@331 having buggy UBO size.

diff --git a/src/main/java/org/distorted/main/RubikRenderer.java b/src/main/java/org/distorted/main/RubikRenderer.java
index 0b575eb8..e35fbba0 100644
--- a/src/main/java/org/distorted/main/RubikRenderer.java
+++ b/src/main/java/org/distorted/main/RubikRenderer.java
@@ -19,9 +19,6 @@
 
 package org.distorted.main;
 
-import android.app.ActivityManager;
-import android.content.Context;
-import android.content.pm.ConfigurationInfo;
 import android.opengl.GLES30;
 import android.opengl.GLSurfaceView;
 
@@ -48,7 +45,6 @@ public class RubikRenderer implements GLSurfaceView.Renderer, DistortedLibrary.E
    private final DistortedScreen mScreen;
    private final Fps mFPS;
    private boolean mErrorShown;
-   private static boolean mSupportsGigaminx;
 
    private static class Fps
      {
@@ -128,12 +124,12 @@ public class RubikRenderer implements GLSurfaceView.Renderer, DistortedLibrary.E
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
       {
       DistortedLibrary.setMax(EffectType.VERTEX,61);    // 60 Minx quaternions + rotate
+      MeshBase.setMaxEffComponents(242);                // 242 moving parts (Gigaminx)
+
       VertexEffectRotate.enable();
       VertexEffectQuaternion.enable();
       BaseEffect.Type.enableEffects();
 
-      assignMaxComponents();
-
       DistortedLibrary.onSurfaceCreated(mView.getContext(),this,1);
       }
 
@@ -178,50 +174,6 @@ public class RubikRenderer implements GLSurfaceView.Renderer, DistortedLibrary.E
        }
      }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Go around bugs on Qualcomm Adreno driver V@331 (present in Samsung Galaxy J4+ and at least some
-// versions of other Samsung Galaxy phones).
-// On this driver, it is not possible to assign more than about 6000 bytes for uniform variables in
-// the vertex shader. We thus need to limit the size of our uniform arrays. The only way seems to be
-// to limit the number of Mesh components, but then on this platform we cannot support the largest
-// object in terms of number of movable parts - the Gigaminx.
-
-   private void assignMaxComponents()
-     {
-     Context context = mView.getContext();
-
-     final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
-     final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
-
-     int glESversion = configurationInfo.reqGlEsVersion;
-     int major = glESversion >> 16;
-     int minor = glESversion & 0xff;
-
-     MeshBase.setMaxEffComponents(242);   // the largest object, Gigaminx, has 242 components
-     mSupportsGigaminx = true;
-
-     if( major==3 && minor==0 )
-       {
-       String vendor  = GLES30.glGetString(GLES30.GL_VENDOR);
-       String version = GLES30.glGetString(GLES30.GL_VERSION);
-
-       if( vendor.contains("Qualcomm") && version.contains("V@331") )
-         {
-         // on driver version 331,  do not support Gigaminx.
-         // Then Cube5 is the largest with 98 components.
-         MeshBase.setMaxEffComponents(98);
-         mSupportsGigaminx = false;
-         }
-       }
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   public static boolean supportsGigaminx()
-     {
-     return mSupportsGigaminx;
-     }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
    float getFPS()
diff --git a/src/main/java/org/distorted/states/RubikStatePlay.java b/src/main/java/org/distorted/states/RubikStatePlay.java
index 46ba82bc..00825561 100644
--- a/src/main/java/org/distorted/states/RubikStatePlay.java
+++ b/src/main/java/org/distorted/states/RubikStatePlay.java
@@ -282,14 +282,11 @@ public class RubikStatePlay extends RubikStateBase
             {
             if( act.getPreRender().canPlay() && StateList.getCurrentState()== StateList.PLAY )
               {
-              if( RubikRenderer.supportsGigaminx() || list!=ObjectList.MEGA || sizes[index]<=3 )
-                {
-                mObject = obj;
-                mSize   = sizes[index];
-                act.changeObject(list,sizes[index], true);
-                adjustLevels(act);
-                mMoves.clear();
-                }
+              mObject = obj;
+              mSize   = sizes[index];
+              act.changeObject(list,sizes[index], true);
+              adjustLevels(act);
+              mMoves.clear();
               }
 
             mObjectPopup.dismiss();
