I have a Nexus 10 with Android 5.0 and I'm getting this "error" when compiling the attached shaders :
12-09 04:33:35.369: I/com.re3.benchmark(5159): L0001 The fragment shader uniform structure Light0 does not match the vertex shader uniform structure Light0.
12-09 04:33:35.369: I/com.re3.benchmark(5159): The precision does not match.
I'm basically declaring a structure in the VS that I'm not using, and I think the compiler optimizes the components out, compares with the one that's used in the FS and then realizes they don't match, but instead it says the precision doesn't match. As you can see my FS is highp and putting highp manually in the VS doesn't change the error returned. I've also encountered a second error with a shader that declares just a uniform in the VS but is only used in the FS.
This shouldn't be an error obviously, and an ETA on a fix would be nice.
I'm reporting another bug here so that at least one will be fixed.
I'm having an issue as in nothing gets rendered with my Instanced Tesselation shader. It uses GL ES 3.0 features like RGBA32F textures, unsigned samplers and instanced rendering. I've upload an APK (download from here : RE3 Benchmark_InstTess_Mali.apk - Google Drive ). Just press Start Benchmark and you will not see the water anymore, tapping InstancedTesselation once will disable the feature and make the water visible. With IT the water has waves and should be visible and have like a dozen times more triangles.
There's actually another error with my app. I have shaders that discard pixels at a certain height. Shaders compile fine but the results are awfully weird and definetely not what is expected.
> This shouldn't be an error obviously, and an ETA on a fix would be nice.
OpenGL ES requires that precision of variables in the two shaders matches - the specification strongly implies that this check is done early (i.e. before we know whether values are used or not) - so I don't think this is a bug in the Mali compiler. The relevant part of the ESSL specification is:
Uniforms in the vertex and fragment shaders share a single global name space. Hence, the types, precisions and any location specifiers of all declared uniform variables with the same name must match across shaders that are linked into a single program.
The specification defines "declaration" as the critical point, not "used", so the compiler is correct to raise a mismatch even if they are not used. I think the issue with your shaders is that you have an integer (LightType) in that structure, and don't set highp precision for integer types in the fragment shader (you only set it for float types).
Note that globally setting highp for everything in a fragment shader is generally bad for performance and power efficiency, and totally overkill for calculating color values, so rather than globally forcing this I'd suggest setting precision on the individual uniform values.
HTH, Pete
Can you try and come up with a smaller test case? What makes you think that Mali is at fault here?
Cheers, Pete
Well, simply because if I run the same shaders on a Desktop or a GLES3 iPad it "just works". Even Qualcomm has an issue with rendering without attributes/vertex buffers, so I can't name a mobile GPU that actually works as of now. Maybe some Androids with PowerVR and GLES3 level GPUs would but I haven't gotten one yet to test. I can make an APK with just the tessellation draw call though.
Thanks for the insight, so the int was it ? It would be nice for the error to say that the "int precision mismatched", most of the time I use floats so I intuitively thought it's about floats and thought it was an error. I force highp because I want to have a somewhat parity at the shader level between the mobile version of my app and the desktop version where everything is 32bit precision by default. My Terrain Shader though after multiplying 6 textures gets very pixelated under mediump.
It would be nice for the error to say that the "int precision mismatched"
Yep, I agree - I'll raise a request with our compiler team
Regards
Pete
Thanks - the additional context is useful.
If possible could you upload a couple of screenshots of the same frame looking correct on desktop, and looking bad on Mali? It's quite difficult to debug without some visual clue of what it is supposed to look like =)
Ok, so after isolating the instanced tesselation shader I can say for certain that Instanced Tesselation, attributeless and instanced rendering works perfectly on the Mali T604 (at least) which is really good news !
However, it seems that my refraction and reflection effects are doing something to the GPU. I've now disabled tesselation, just enabled reflections which renders everything twice ( in the second pass it uses the image generated in the first pass ) and while some objects disappear ( they have discard in the PS, but only in the first pass, not the second one which uses different shaders without discard ), after about ~30 seconds I'm getting GL_OUT_OF_MEMORY errors. Here's the updated build : RE3 Benchmark_Refl_Out_Of_Memory.apk - Google Drive .
I don't update buffers or textures so I'm not creating new objects, and a Task Manager app says I'm only using ~75 MB of memory so I kind of doubt it's really out of memory.
I'm just looking deeper into this.
You're right that it may not to be an actual memory shortage, there are a limited number of GLES error codes and so "out of memory" could point to something else without a specific error code, but at this stage I don't want to write off any possibility.
-Stacy