I have the following uniform:
#define POLYLINE_SIZE 16
uniform highp vec2 u_polyline[POLYLINE_SIZE];
In the vertex shader I'm doing the following to interpolate a position between two points of the polyline:
vec2 pt1 = u_polyline[int(idx)];
vec2 pt2 = u_polyline[int(idx)+1];
vec2 pos = pt1 + (pt2 - pt1) * idx_diff;
On a Nexus 7 2nd Gen (Adreno 320), "pos" is incorrect, and is being calculated as if I was using pt2 instead of pt1 (but the direction is still correctly calculated between pt1 and pt2). So, for some reason the output is equivalent to:vec2 pos = pt2 + (pt2 - pt1) * idx_diff;
Interestingly, if I change to the following, the "pos" is correct:vec2 pos = u_polyline[int(idx)] + (pt2 - pt1) * idx_diff;
Is this a bug of the Adreno?