-
Enhancement
-
Resolution: Unresolved
-
P3
-
None
I noticed this code segment appeared in 2 of 3 inlined add quad methods:
byte barr[] = colorArray;
byte r = this.r, g = this.g, b = this.b, a = this.a;
int j = BYTES_PER_VERT * idx;
barr[ j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
barr[++j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
barr[++j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
barr[++j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
We should avoid storing constants in attribute arrays as it is a waste of bandwidth and memory. This is a 12.5% saving given that we have 7 floats per cood and 1 float per color.
(Filed on behalf of Chien)
byte barr[] = colorArray;
byte r = this.r, g = this.g, b = this.b, a = this.a;
int j = BYTES_PER_VERT * idx;
barr[ j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
barr[++j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
barr[++j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
barr[++j] = r; barr[++j] = g; barr[++j] = b; barr[++j] = a;
We should avoid storing constants in attribute arrays as it is a waste of bandwidth and memory. This is a 12.5% saving given that we have 7 floats per cood and 1 float per color.
(Filed on behalf of Chien)