From af8d39861de25fc8af1a173b197eef9ee88b48a5 Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Fri, 24 Mar 2006 16:33:34 +0000 Subject: [PATCH] secondary color fixes. --- src/mesa/drivers/dri/r300/r300_maos.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index c2ff9c5d983..1aa005c7207 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -377,7 +377,21 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd) } if (inputs & _TNL_BIT_COLOR1) { - CONFIGURE_AOS(i_color[1], AOS_FORMAT_FLOAT_COLOR, + int emitsize=4; + + if (!immd) { + if (VB->AttribPtr[VERT_ATTRIB_COLOR1].size == 4 && + (VB->AttribPtr[VERT_ATTRIB_COLOR1].stride != 0 || + ((float*)VB->AttribPtr[VERT_ATTRIB_COLOR1].data)[3] != 1.0)) { + emitsize = 4; + } else { + emitsize = 3; + }//emitsize = VB->AttribPtr[VERT_ATTRIB_COLOR1].size; + } + if(VB->AttribPtr[VERT_ATTRIB_COLOR1].type == GL_UNSIGNED_BYTE) + emitsize = 1; + + CONFIGURE_AOS(i_color[1], VB->AttribPtr[VERT_ATTRIB_COLOR1].type == GL_UNSIGNED_BYTE ? AOS_FORMAT_UBYTE : AOS_FORMAT_FLOAT_COLOR, VB->AttribPtr[VERT_ATTRIB_COLOR1], immd ? 4 : VB->AttribPtr[VERT_ATTRIB_COLOR1].size, count); -- 2.30.2