Revision 2b7d2abb
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/library/effectqueue/EffectQueue.java | ||
---|---|---|
43 | 43 |
|
44 | 44 |
static final int VERT_INT_UBO_BINDING = 5; |
45 | 45 |
static final int VERT_FLO_UBO_BINDING = 6; |
46 |
static final int FRAG_INT_UBO_BINDING = 7; |
|
47 |
static final int FRAG_FLO_UBO_BINDING = 8; |
|
48 | 46 |
|
49 | 47 |
private static final int CREATE = 0; |
50 | 48 |
private static final int ATTACH = 1; |
... | ... | |
67 | 65 |
{ |
68 | 66 |
int type; |
69 | 67 |
int num1, num2; |
70 |
boolean notify;
|
|
68 |
boolean bool;
|
|
71 | 69 |
Effect effect; |
72 | 70 |
|
73 | 71 |
Job(int t, int m1, int m2, boolean n, Effect e) |
... | ... | |
75 | 73 |
type = t; |
76 | 74 |
num1 = m1; |
77 | 75 |
num2 = m2; |
78 |
notify= n;
|
|
76 |
bool = n;
|
|
79 | 77 |
effect= e; |
80 | 78 |
} |
81 | 79 |
} |
... | ... | |
84 | 82 |
|
85 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
86 | 84 |
|
87 |
EffectQueue(int numFloatUniforms, int numIntUniforms, int index) |
|
85 |
EffectQueue(int numFloatUniforms, int numIntUniforms, boolean useUBO, int index)
|
|
88 | 86 |
{ |
89 | 87 |
mCreated = false; |
90 | 88 |
mTime = 0; |
... | ... | |
95 | 93 |
|
96 | 94 |
mJobs = new ArrayList<>(); |
97 | 95 |
|
98 |
mJobs.add(new Job(CREATE,numFloatUniforms,numIntUniforms, false,null)); // create the stuff that depends on max number
|
|
96 |
mJobs.add(new Job(CREATE,numFloatUniforms,numIntUniforms,useUBO,null)); // create the stuff that depends on max number
|
|
99 | 97 |
InternalMaster.newSlave(this); // of uniforms later, on first render. |
100 | 98 |
} |
101 | 99 |
|
... | ... | |
442 | 440 |
if( max>0 ) |
443 | 441 |
{ |
444 | 442 |
mEffects= new Effect[max]; |
445 |
mUBF = new UniformBlockFloatUniforms(job.num1, max); |
|
446 |
mUBI = new UniformBlockIntUniforms (job.num2, max); |
|
443 |
mUBF = new UniformBlockFloatUniforms(job.num1, max, job.bool);
|
|
444 |
mUBI = new UniformBlockIntUniforms (job.num2, max, job.bool);
|
|
447 | 445 |
} |
448 | 446 |
mCreated = true; |
449 | 447 |
|
... | ... | |
488 | 486 |
mEffects[j] = null; |
489 | 487 |
} |
490 | 488 |
|
489 |
// TODO: notify listeners? |
|
490 |
/* if( job.bool ) |
|
491 |
{ |
|
492 |
// ... |
|
493 |
} |
|
494 |
*/ |
|
495 |
|
|
491 | 496 |
mNumEffects= 0; |
492 | 497 |
break; |
493 | 498 |
} |
Also available in: Unified diff
Remove UBO from the fragment shader and come back to the default of only 5 concurrent fragment effects. All because UBOs in fragment shader crash on Adreno 510 and Adreno 506.