diff options
author | Keith Whitwell <[email protected]> | 2005-05-11 10:30:13 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2005-05-11 10:30:13 +0000 |
commit | a5820159056fb9c3f5da6b3ae4570cd97b95835d (patch) | |
tree | 0b23dce5ddb029ed66e7ec752f77adbdc9e71e79 /src/mesa/swrast_setup | |
parent | 3509fd8c1b38d955a066a2bad429dbfba162fa30 (diff) |
Fix valgrind complaint, conform vertex order test.
Diffstat (limited to 'src/mesa/swrast_setup')
-rw-r--r-- | src/mesa/swrast_setup/ss_tritmp.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 34ea1e1e9de..61c9b2817e6 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -70,9 +70,16 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) COPY_CHAN4(saved_color[1], v[1]->color); COPY_CHAN4(saved_color[2], v[2]->color); - SS_COLOR(v[0]->color, vbcolor[e0]); - SS_COLOR(v[1]->color, vbcolor[e1]); - SS_COLOR(v[2]->color, vbcolor[e2]); + if (VB->ColorPtr[1]->stride) { + SS_COLOR(v[0]->color, vbcolor[e0]); + SS_COLOR(v[1]->color, vbcolor[e1]); + SS_COLOR(v[2]->color, vbcolor[e2]); + } + else { + SS_COLOR(v[0]->color, vbcolor[0]); + SS_COLOR(v[1]->color, vbcolor[0]); + SS_COLOR(v[2]->color, vbcolor[0]); + } if (VB->SecondaryColorPtr[1]) { GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; @@ -81,9 +88,16 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) COPY_CHAN4(saved_spec[1], v[1]->specular); COPY_CHAN4(saved_spec[2], v[2]->specular); - SS_SPEC(v[0]->specular, vbspec[e0]); - SS_SPEC(v[1]->specular, vbspec[e1]); - SS_SPEC(v[2]->specular, vbspec[e2]); + if (VB->SecondaryColorPtr[1]->stride) { + SS_SPEC(v[0]->specular, vbspec[e0]); + SS_SPEC(v[1]->specular, vbspec[e1]); + SS_SPEC(v[2]->specular, vbspec[e2]); + } + else { + SS_SPEC(v[0]->specular, vbspec[0]); + SS_SPEC(v[1]->specular, vbspec[0]); + SS_SPEC(v[2]->specular, vbspec[0]); + } } } else { GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; |