Revision a9d4bb9a
Added by Leszek Koltunski over 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, mNeedsTransformFeedback; |
119 |
private static boolean mBuggyUBOs; |
|
120 | 119 |
|
121 | 120 |
private static int mMaxTextureSize = Integer.MAX_VALUE; |
122 | 121 |
private static int mMaxNumberOfVerUniforms = Integer.MAX_VALUE; |
123 | 122 |
private static int mMaxNumberOfFraUniforms = Integer.MAX_VALUE; |
124 | 123 |
|
124 |
private static boolean mBuggyUBOs; |
|
125 |
private static String mVendor, mVersion, mRenderer; |
|
126 |
|
|
125 | 127 |
////////////////////////////////////////////////////////////////////////////////////////////// |
126 | 128 |
/// MAIN PROGRAM /// |
127 | 129 |
private static DistortedProgram mMainProgram; |
... | ... | |
889 | 891 |
|
890 | 892 |
private static void detectBuggyDriversAndSetQueueSize(int queueSize) |
891 | 893 |
{ |
892 |
String vendor = GLES30.glGetString(GLES30.GL_VENDOR);
|
|
893 |
String version = GLES30.glGetString(GLES30.GL_VERSION);
|
|
894 |
String renderer= GLES30.glGetString(GLES30.GL_RENDERER);
|
|
894 |
mVendor = GLES30.glGetString(GLES30.GL_VENDOR);
|
|
895 |
mVersion = GLES30.glGetString(GLES30.GL_VERSION);
|
|
896 |
mRenderer= GLES30.glGetString(GLES30.GL_RENDERER);
|
|
895 | 897 |
|
896 | 898 |
mFBOQueueSize = 1; |
897 | 899 |
|
898 |
if( vendor.contains("ARM") )
|
|
900 |
if( mVendor.contains("ARM") )
|
|
899 | 901 |
{ |
900 | 902 |
try |
901 | 903 |
{ |
902 | 904 |
String regex = ".*r(\\d+)p\\d.*"; |
903 | 905 |
Pattern pattern = Pattern.compile(regex); |
904 |
Matcher matcher = pattern.matcher(version);
|
|
906 |
Matcher matcher = pattern.matcher(mVersion);
|
|
905 | 907 |
|
906 | 908 |
if( matcher.find() ) |
907 | 909 |
{ |
... | ... | |
926 | 928 |
android.util.Log.e("library", "exception trying to pattern match version: "+ex.toString()); |
927 | 929 |
} |
928 | 930 |
} |
929 |
else if( vendor.contains("Imagination") )
|
|
931 |
else if( mVendor.contains("Imagination") )
|
|
930 | 932 |
{ |
931 |
if( renderer.contains("GE8") )
|
|
933 |
if( mRenderer.contains("GE8") )
|
|
932 | 934 |
{ |
933 | 935 |
Log.e("DISTORTED", "You are running this on a PowerVR GE8XXX.\nDue to a buggy compiler OIT rendering will not work"); |
934 | 936 |
Log.e("DISTORTED", "GLSL Version "+GLES30.glGetString(GLES31.GL_SHADING_LANGUAGE_VERSION)); |
935 | 937 |
} |
936 | 938 |
} |
937 |
else if( vendor.contains("Qualcomm"))
|
|
939 |
else if( mVendor.contains("Qualcomm"))
|
|
938 | 940 |
{ |
939 |
if( version.contains("V@331.0") )
|
|
941 |
if( mVersion.contains("V@331.0") )
|
|
940 | 942 |
{ |
941 | 943 |
Log.e("DISTORTED", "You are running this on an Adreno 3xx driver version 331.\nStrange shit might happen."); |
942 | 944 |
mBuggyUBOs = true; |
... | ... | |
1226 | 1228 |
{ |
1227 | 1229 |
return EffectQueue.setMax(type.ordinal(),max); |
1228 | 1230 |
} |
1231 |
|
|
1232 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1233 |
/** |
|
1234 |
* Return a String defining the vendor of the graphics driver. |
|
1235 |
*/ |
|
1236 |
public static String getDriverVendor() |
|
1237 |
{ |
|
1238 |
return mVendor; |
|
1239 |
} |
|
1240 |
|
|
1241 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1242 |
/** |
|
1243 |
* Return a String defining the version of the graphics driver. |
|
1244 |
*/ |
|
1245 |
public static String getDriverVersion() |
|
1246 |
{ |
|
1247 |
return mVersion; |
|
1248 |
} |
|
1249 |
|
|
1250 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1251 |
/** |
|
1252 |
* Return a String defining the renderer of the graphics driver. |
|
1253 |
*/ |
|
1254 |
public static String getDriverRenderer() |
|
1255 |
{ |
|
1256 |
return mRenderer; |
|
1257 |
} |
|
1229 | 1258 |
} |
Also available in: Unified diff
- report the Graphics driver's Renderer and Version.
- new Diamond, Skewb2 and Skewb3 meshes.