Revision 97b6c85e
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/library/main/DistortedLibrary.java | ||
---|---|---|
116 | 116 |
private static int mGLSL; |
117 | 117 |
private static String mGLSL_VERSION; |
118 | 118 |
private static boolean mOITCompilationAttempted; |
119 |
private static boolean mNeedsTransformFeedback; |
|
119 | 120 |
|
120 | 121 |
private static int mMaxTextureSize = Integer.MAX_VALUE; |
121 | 122 |
private static int mMaxNumberOfVerUniforms = Integer.MAX_VALUE; |
... | ... | |
255 | 256 |
|
256 | 257 |
try |
257 | 258 |
{ |
258 |
mMainProgram = new DistortedProgram(mainVertStream, mainFragStream, mainVertHeader, mainFragHeader, |
|
259 |
enabledEffectV, enabledEffectF, mGLSL, feedback); |
|
259 |
mMainProgram = new DistortedProgram(mainVertStream, mainFragStream, mainVertHeader, |
|
260 |
mainFragHeader, enabledEffectV, enabledEffectF, |
|
261 |
mGLSL, mNeedsTransformFeedback ? feedback : null ); |
|
260 | 262 |
} |
261 | 263 |
catch(Exception e) |
262 | 264 |
{ |
... | ... | |
926 | 928 |
Log.e("DISTORTED", "GLSL Version "+GLES30.glGetString(GLES31.GL_SHADING_LANGUAGE_VERSION)); |
927 | 929 |
} |
928 | 930 |
} |
931 |
else if( vendor.contains("Qualcomm")) |
|
932 |
{ |
|
933 |
if( version.contains("V@331.0") ) |
|
934 |
{ |
|
935 |
Log.e("DISTORTED", "You are running this on an Adreno 3xx driver version 331.\nStrange shit might happen."); |
|
936 |
} |
|
937 |
} |
|
929 | 938 |
} |
930 | 939 |
|
931 | 940 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
1164 | 1173 |
return mMaxTextureSize; |
1165 | 1174 |
} |
1166 | 1175 |
|
1176 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1177 |
/** |
|
1178 |
* Call this before calling onSurfaceCreated() if you want to access normal vectors in CPU. |
|
1179 |
*/ |
|
1180 |
public static void needTransformFeedback() |
|
1181 |
{ |
|
1182 |
mNeedsTransformFeedback = true; |
|
1183 |
} |
|
1184 |
|
|
1167 | 1185 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
1168 | 1186 |
/** |
1169 | 1187 |
* Returns the maximum number of effects of a given type that can be simultaneously applied to a |
Also available in: Unified diff
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.