summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorAapo Tahkola <[email protected]>2006-03-24 16:33:34 +0000
committerAapo Tahkola <[email protected]>2006-03-24 16:33:34 +0000
commitaf8d39861de25fc8af1a173b197eef9ee88b48a5 (patch)
tree2828156aff06f5f2ec392fdd01fc39670c1ee553 /src/mesa/drivers
parentc4f2710f9d474049bfbbebdb9dad2466e6a3ac94 (diff)
secondary color fixes.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r300/r300_maos.c16
1 files changed, 15 insertions, 1 deletions
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);