Using integers in branch conditions can cause the shader compiler to crash.
The following vertex shader kills the program during compilation:
#version 300 esprecision mediump float;uniform vec4 g_vector;uniform float g_scalar;uniform int g_integer;void main(){vec4 Temp = g_vector;// Commenting out this condition allows the program to compile.if (g_integer != 0){Temp.w = g_scalar;}// Or commenting out this line succeeds.Temp.x = dot(Temp.xy, Temp.zw);gl_Position = Temp;}
Yes, I have seen similar crashes, in my case with uints and the > operator.. if(a > b) {blah}. Often crashes the compiler.
Hello Matt.
I wrote a small sample app using your shader and tested on an 8974 Snapdragon ("801") device [Adreno 330], and there were no problems with the integer branch.
I tried to test my sample on a Fire TV and discovered (using "CPU-Z", which is available for free download on the app store) that the device is OpenGL ES 2.0 only, and does not appear to support 3.0, which would explain your findings. My device has a "Software Version of 51.1.4.3_user_514020320", which appears newer than your version, so that couldn't be the issue.
I have so far been unable to test on a Kindle Fire HDX because the devices I have are running Android Jellybean, and so it is not possible to run my sample app on them. I will probably get an updated Fire HDX on Monday.
In the meantime, could you try running "CPU-Z" on the Kindle Fire HDX device you are testing on, and verify that it supports OpenGL ES 3.0?
Thanks.