Revision 2301cb2f
Added by Leszek Koltunski almost 6 years ago
src/main/java/org/distorted/library/main/Distorted.java | ||
---|---|---|
81 | 81 |
* Work around bugs in ARM Mali driver by, instead to a single FBO, rendering to a circular queue |
82 | 82 |
* of FBO_QUEUE_SIZE FBOs. (otherwise we sometimes get a 'full pipeline flush' and the end result |
83 | 83 |
* might be missing part of the Objects) |
84 |
* |
|
85 |
* This bug only exists on Mali driver r12. TODO: on other platforms, make this equal to 1. |
|
86 |
* |
|
87 |
* https://community.arm.com/graphics/f/discussions/10285/opengl-es-3-1-on-mali-t880-flashes |
|
84 | 88 |
*/ |
85 |
public static final int FBO_QUEUE_SIZE = 4;
|
|
89 |
public static final int FBO_QUEUE_SIZE = 3;
|
|
86 | 90 |
|
87 | 91 |
private static boolean mInitialized=false; |
88 | 92 |
|
... | ... | |
118 | 122 |
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
119 | 123 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
120 | 124 |
android.util.Log.e("DISTORTED", "Using OpenGL ES "+configurationInfo.getGlEsVersion()); |
121 |
|
|
125 |
/* |
|
126 |
android.util.Log.e("DISTORTED", "GLSL Version "+GLES31.glGetString(GLES31.GL_SHADING_LANGUAGE_VERSION)); |
|
127 |
android.util.Log.e("DISTORTED", "GL Version " +GLES31.glGetString(GLES31.GL_VERSION)); |
|
128 |
android.util.Log.e("DISTORTED", "GL Vendor " +GLES31.glGetString(GLES31.GL_VENDOR)); |
|
129 |
android.util.Log.e("DISTORTED", "GL Renderer " +GLES31.glGetString(GLES31.GL_RENDERER)); |
|
130 |
*/ |
|
122 | 131 |
GLSL = ( (configurationInfo.reqGlEsVersion>>16)>=3 ? 310 : 100 ); |
123 | 132 |
GLSL_VERSION= (GLSL==100 ? "#version 100\n" : "#version 310 es\n"); |
124 | 133 |
|
Also available in: Unified diff
I am pretty sure this time the flashing issues on Mali T880 r12 driver are finally fixed.
The fix: a queue of FBOs render to, just like before, but this time in DistortedScreen we blit not the current FBO, but the one computed several frames ago.
This of course introduces a delay and uses more memory, but it appears to work and does not seem to have any effects on speed.