commit 073e5a7a92260f85d02c1b7c41fafd3e55b48f45
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Mar 12 22:33:59 2021 +0100

    Another attempt at fixing tthings on early Qualcomm OpenGL ES 3.0 drivers.
    
    The previous version does not work on Adreno 405 driver V@100, present for example in a Asus ZenPad 8.
    Revert the packed 'ivec2' UBO in the vertex shader back to a 'std140' ivec4. This comes at a price if bumping into the bug on Qualcomm driver version 331 on Adreno 308 - i.e. Samsung Galaxy J4+ again.
    
    On this platform, switch off Gigaminx and then set MAX_COMPONENTS to 98.

diff --git a/src/main/java/org/distorted/library/mesh/MeshBase.java b/src/main/java/org/distorted/library/mesh/MeshBase.java
index 894bd22..252d383 100644
--- a/src/main/java/org/distorted/library/mesh/MeshBase.java
+++ b/src/main/java/org/distorted/library/mesh/MeshBase.java
@@ -51,7 +51,8 @@ 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= 242;
+
+   public static 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
@@ -573,6 +574,15 @@ public abstract class MeshBase
      return MAX_EFFECT_COMPONENTS;
      }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * How many mesh components are we going to need? Call before compilation of the shaders.
+ */
+   public static void setMaxEffComponents(int max)
+     {
+     MAX_EFFECT_COMPONENTS = max;
+     }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
    public static void getUniforms(int programH, int variant)
diff --git a/src/main/java/org/distorted/library/uniformblock/UniformBlockAssociation.java b/src/main/java/org/distorted/library/uniformblock/UniformBlockAssociation.java
index 019ede5..d59045e 100644
--- a/src/main/java/org/distorted/library/uniformblock/UniformBlockAssociation.java
+++ b/src/main/java/org/distorted/library/uniformblock/UniformBlockAssociation.java
@@ -34,7 +34,7 @@ import static org.distorted.library.mesh.MeshBase.MAX_EFFECT_COMPONENTS;
 public class UniformBlockAssociation
   {
   private static final int DEFAULT_ASSOCIATION = 0xffffffff;
-  private static final int DEFAULT_STRIDE = 2;
+  private static final int DEFAULT_STRIDE = 4;
   private static final int LOC_AND = 0;
   private static final int LOC_EQU = 1;
 
diff --git a/src/main/res/raw/main_vertex_shader.glsl b/src/main/res/raw/main_vertex_shader.glsl
index 2b2f093..ffb08ed 100644
--- a/src/main/res/raw/main_vertex_shader.glsl
+++ b/src/main/res/raw/main_vertex_shader.glsl
@@ -65,9 +65,9 @@ layout (std140) uniform vUniformFloats
                                       // second vec4: first float - cache, next 3: Center, the third -  the Region.
   };
 
-layout (packed) uniform componentAssociation
+layout (std140) uniform componentAssociation
   {
-  ivec2 vComAssoc[MAX_COMPON];        // component 'AND' and 'EQU' Associations
+  ivec4 vComAssoc[MAX_COMPON];        // component 'AND' and 'EQU' Associations
   };
 
 //////////////////////////////////////////////////////////////////////////////////////////////
