This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Strange compiler results

Using the following (example) shader, I encountered a behaviour I cannot make sense of:

 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#version 310 es
precision mediump float;
precision lowp int;
precision mediump sampler2D;
uniform sampler2D input0;
uniform sampler2D input1;
uniform mediump sampler2D weights0;
uniform mediump sampler2D weights1;
in highp vec2 texCoord;
flat in lowp ivec2 wgtCoord;
layout(location=0) out vec4 fragmentColor0;
const lowp vec4 ones=vec4(1,1,1,1);
const lowp float screenScale = 1.0;
const lowp vec2 center = vec2(0.5,0.5);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When using the offline compiler, I get the following statistics (using -c Mali-T880):

Fullscreen
1
2
3
4
5
6
8 work registers used, 1 uniform registers used, spilling used.
A L/S T Bound
Instructions Emitted: 68 5 43 A
Shortest Path Cycles: 23 5 43 T
Longest Path Cycles: 23 5 43 T
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Now, when I re-enable the comment-block in the code above, I would expect the number of texture fetches to double and L/S to remain as it is.

Instead I get this:

Fullscreen
1
2
3
4
5
6
8 work registers used, 1 uniform registers used, spilling used.
A L/S T Bound
Instructions Emitted: 130 79 86 A
Shortest Path Cycles: 44 79 86 T
Longest Path Cycles: 44 79 86 T
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is this a case of bad register allocation by the compiler ? The activated code-block has no data-dependency (at least not in a RAW sense) with the preceding block of code.

 

 

0