{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- if (VB->ColorPtr[1]) {
+ /* If stride is zero, ColorPtr[1] is constant across the VB, so
+ * there is no point interpolating between two values as they will
+ * be identical. In all other cases, this value is generated by
+ * t_vb_lighttmp.h and has a stride of 4 dwords.
+ */
+ if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) {
assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
INTERP_4F( t,
VB->ColorPtr[1]->data[dst],
VB->ColorPtr[1]->data[out],
VB->ColorPtr[1]->data[in] );
+ }
- if (VB->SecondaryColorPtr[1]) {
- INTERP_3F( t,
- VB->SecondaryColorPtr[1]->data[dst],
- VB->SecondaryColorPtr[1]->data[out],
- VB->SecondaryColorPtr[1]->data[in] );
- }
+ if (VB->SecondaryColorPtr[1]) {
+ assert(VB->SecondaryColorPtr[1]->stride == 4 * sizeof(GLfloat));
+
+ INTERP_3F( t,
+ VB->SecondaryColorPtr[1]->data[dst],
+ VB->SecondaryColorPtr[1]->data[out],
+ VB->SecondaryColorPtr[1]->data[in] );
}
- else if (VB->IndexPtr[1]) {
+
+ if (VB->IndexPtr[1]) {
VB->IndexPtr[1]->data[dst][0] = LINTERP( t,
VB->IndexPtr[1]->data[out][0],
VB->IndexPtr[1]->data[in][0] );
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- if (VB->ColorPtr[1]) {
+ /* See above comment:
+ */
+ if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) {
COPY_4FV( VB->ColorPtr[1]->data[dst],
VB->ColorPtr[1]->data[src] );
+ }
- if (VB->SecondaryColorPtr[1]) {
- COPY_4FV( VB->SecondaryColorPtr[1]->data[dst],
- VB->SecondaryColorPtr[1]->data[src] );
- }
+ if (VB->SecondaryColorPtr[1]) {
+ COPY_4FV( VB->SecondaryColorPtr[1]->data[dst],
+ VB->SecondaryColorPtr[1]->data[src] );
}
- else if (VB->IndexPtr[1]) {
+
+ if (VB->IndexPtr[1]) {
VB->IndexPtr[1]->data[dst][0] = VB->IndexPtr[1]->data[src][0];
}