Revision 073e5a7a
Added by Leszek Koltunski over 4 years ago
| 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= 242; |
|
| 54 |
|
|
| 55 |
public static int MAX_EFFECT_COMPONENTS= 100; |
|
| 55 | 56 |
|
| 56 | 57 |
// sizes of attributes of an individual vertex. |
| 57 | 58 |
private static final int POS_DATA_SIZE= 3; // vertex coordinates: x,y,z |
| ... | ... | |
| 573 | 574 |
return MAX_EFFECT_COMPONENTS; |
| 574 | 575 |
} |
| 575 | 576 |
|
| 577 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 578 |
/** |
|
| 579 |
* How many mesh components are we going to need? Call before compilation of the shaders. |
|
| 580 |
*/ |
|
| 581 |
public static void setMaxEffComponents(int max) |
|
| 582 |
{
|
|
| 583 |
MAX_EFFECT_COMPONENTS = max; |
|
| 584 |
} |
|
| 585 |
|
|
| 576 | 586 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 577 | 587 |
|
| 578 | 588 |
public static void getUniforms(int programH, int variant) |
| src/main/java/org/distorted/library/uniformblock/UniformBlockAssociation.java | ||
|---|---|---|
| 34 | 34 |
public class UniformBlockAssociation |
| 35 | 35 |
{
|
| 36 | 36 |
private static final int DEFAULT_ASSOCIATION = 0xffffffff; |
| 37 |
private static final int DEFAULT_STRIDE = 2;
|
|
| 37 |
private static final int DEFAULT_STRIDE = 4;
|
|
| 38 | 38 |
private static final int LOC_AND = 0; |
| 39 | 39 |
private static final int LOC_EQU = 1; |
| 40 | 40 |
|
| src/main/res/raw/main_vertex_shader.glsl | ||
|---|---|---|
| 65 | 65 |
// second vec4: first float - cache, next 3: Center, the third - the Region. |
| 66 | 66 |
}; |
| 67 | 67 |
|
| 68 |
layout (packed) uniform componentAssociation
|
|
| 68 |
layout (std140) uniform componentAssociation
|
|
| 69 | 69 |
{
|
| 70 |
ivec2 vComAssoc[MAX_COMPON]; // component 'AND' and 'EQU' Associations
|
|
| 70 |
ivec4 vComAssoc[MAX_COMPON]; // component 'AND' and 'EQU' Associations
|
|
| 71 | 71 |
}; |
| 72 | 72 |
|
| 73 | 73 |
////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
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.