Hi,
I'm using Nexus 4 to develop games, but can't get high performance. Then I use simple fragement shaders to test.
The first code using MAD is as below:
precision mediump float;
uniform mediump vec4 color_in;
void main() {
mediump vec4 color_out1 = color_in;
for(int i = 0; i < 100; i ++)
{
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
color_out1 = color_out1 * color_in + color_in;
}
gl_FragColor = color_out1;
}
Using above fragement shader, I only get 80% alu capability from the result of adreno profiler.
The second code using MUL is as below:
precision mediump float;
uniform mediump vec4 color_in;
void main() {
mediump vec4 color_out1 = color_in;
for(int i = 0; i < 100; i ++)
{
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
color_out1 = color_out1 * color_in ;
}
gl_FragColor = color_out1;
}
Using above fragement shader, I only get 100% alu capability from the result of adreno profiler.
Why MAD operation can't get 100% alu capabilty?
I see you have the profiler working on Nexus 4! Got any tips on how you did that? Qualcomm hasn't been answering my questions I've posted in the last few days about this.
If you can help me get it running on my nexus 4, I'll see if I can help come up with an ALU test. The problem I have is the WARNING! ADB found a device, but no Adreno profiler enabled application can be found..." I get the same message if I try their Skinning2 demo or "Reign of Amira"
It's possible that the shader compiler is doing some unforeseen optimization, or that there is something happening with the geometry to cause a stall.
Can you provide us with the complete shaders (vertex and fragment) and perhaps a sample program that you're using? (having it available on a dropbox would be great)
Also which version of the Adreno Profiler are you using? It might be good to know what alu capability it is reporting.
-mark