Forums - Possible Adreno bug with uniform array

1 post / 0 new
Possible Adreno bug with uniform array
COR3 NDrive
Join Date: 1 Oct 10
Posts: 7
Posted: Tue, 2018-01-09 03:47

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 GPU?

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.