Hi,
We're having a serious crash on several devices when using one of our shaders, when using that shader the device blocks and restarts.
However it works fine on other devices, or partially on newer Adreno models(eg. 300).
Devices:
Sony Xperia Tipo v 4.0.4, HTC Sensation v 4.0.3, HTC Desire 500 v 4.1.2
All of those are using, early Adreno 2xx models so it seems to be tied to that.
I've tried using Adreno Profiler on MacOSX 10.9.5 to see if I can get more info on this but can't connect to the devices, it says found a device but no Adreno Profiler-enabled app.
Despite having done all the suggested steps, adding android.permission.INTERNET and com.qti.permission.PROFILER in the app manifest and opening the app. via open.
Finally, commenting code from the fragment shader does fix the crash however I haven't found what exactly causes it.
So please let me know if you need the apk/shader files or have any suggestions on how to trace the cause of the issue.
EDIT:
After restarting the profiler and device it finally can connect to our app. but it can't capture a frame correctly or crashes it. So it's clear it doesn't support it.
Still could I get some support on the saders issues? It's clearly a driver/compiler issues with too agressive optimizations.
The shader works correctly on PowerVR devices and other.
Glad you were able to figure out the profiler connection, but curious about the crash.
Is there an apk you can share with us?
Also is there shader code you can share and explain what you commented out to get it to work.
Admittingly the Adreno 200 devices are rather old, and our support options are very limited.
Thank you for the response.
Yes I can, however I can't just post them here due to company rules so please let me know of an e-mail(I see the forum doesn't have PM support) where I can send you the shaders and apk.
The reasons I've commented the code is that I've seen other cases where valid GLSL causing crashes in glLinkProgram, like:
https://developer.qualcomm.com/forum/qdevnet-forums/mobile-technologies/...
https://developer.qualcomm.com/forum/qdevnet-forums/mobile-gaming-graphi...
And other.
Thus I've cleaned up the shader and it didn't crashed anymore glLinkProgram, but like I said it crashes the device when used.
Yes, I'm aware the hardware is old however even on an Adreno 305(Samsung Galaxy S4 mini OS:4.4.2) even if it doesn't crash it produces major artifacts. But it does work on an Adreno 330 device(OnePlus One OS:4.4.4). And it can't be floating precision issues as I've fixed the code for other devices and double checked for weak spots.
Adreno 305: http://s17.postimg.org/uap4twfvj/samasung_s4_mini_prenavi.png
Adreno 330: http://s15.postimg.org/rdtgqt4mj/1_1_prenavi.png
So I'm presuming this is a driver issue, so would compiling the shader on the 330 device and geting the binary code would create compatible shader for all Adreno devices?
Scratch that about the 305 device, it works fine on it too. QA did tests on a Mali device and reported it as an Samsung Galaxy s4 mini.
We tried your shader and it fails to compile on all of the Adreno devices we tried, unless the following missing functions are defined in the fragment shader: 'aliasingDepth', 'cap', 'roundi', and 'join'.
Once we created simple versions of these functions, the shader compiled and linked fine on an Adreno 200 device even with USE_OUTLINE defined in the fragment shader, and even with lines 224 to 251 uncommented:
02-10 01:33:11.762: I/Adreno200(7574): OpenGL ES version found: OpenGL ES 2.0 [email protected] AU@ HAREESHG_Nondeterministic_AU+PATCH[ES]_msm8960_JB_1.9.6_MR2_CL3219408_release_ENGG (CL@3219408)
02-10 01:33:11.762: I/Adreno200(7574): OpenGL shading language version found: OpenGL ES GLSL ES 1.00
02-10 01:33:11.992: I/Adreno200(7574): Successfully initialized the shaders!
So unfortunately, at this point we are unable to reproduce the errors you mentioned.
Can you add some calls to glGetShaderInfoLog and print the output log buffer after your glCompileShader call for the fragment shader.
thanks...
Ohh, I presumed you will test using our .apk's and there you have those functions in a separate file(for faster loading and code reuse).
I've mailed you that file with the helper functions. Have you tried our .apk's? You will surely reproduce them there.
The problem isn't with compiling but linking, thus the compile info log is an empty string(no warnings or something).
Linking info log:
--From Fragment Shader:
--From Vertex Shader:
Program object validation failed.
Let me know if you need anything else.
This might be helpfull for other cases, tyring to find a workaround for this we've found that the compiler has issues with function calls:
if( (v_dx <= v_start) && (dash_start <= v_start) && (dash_stop > v_start) ) {
d = cap(dash_caps.x, v_dx, v_dy, t);
}
else if( (v_dx >= v_length) && (dash_stop > v_length) && (dash_start < v_length) ) {
d = cap(dash_caps.y, v_dx-v_length, v_dy, t);
}
else if( dash_type < 0.0 ) {
d = cap(dash_caps.y, u-dash_center, v_dy, t);
if( inner )
d = max(d,d_join);
}
else if( dash_type > 0.0 ) {
d = cap(dash_caps.x, dash_center-u, v_dy, t);
if( inner )
d = max(d,d_join);
}
else if( dash_type == 0.0 )
d = abs(v_dy);
Changing the code to call the function once would fix the linking error and device crash:
vec4 args;
if( (v_dx <= v_start) && (dash_start <= v_start) && (dash_stop > v_start) ) {
args = vec4(dash_caps.x, v_dx, v_dy, t);
}
else if( (v_dx >= v_length) && (dash_stop > v_length) && (dash_start < v_length) ) {
args = vec4(dash_caps.y, v_dx-v_length, v_dy, t);
}
else if( dash_type < 0.0 ) {
args = vec4(dash_caps.y, u-dash_center, v_dy, t);
}
else if( dash_type > 0.0 ) {
args = vec4(dash_caps.x, dash_center-u, v_dy, t);
}
if( dash_type == 0.0 )
d = abs(v_dy);
else
{
d = cap(args.x,args.y,args.z,args.w);
if( inner )
d = max(d,d_join);
}
Afterwards there's more logic where we haven't found a workaround for and the device still crashes.