summaryrefslogtreecommitdiffstats
path: root/src/mesa/array_cache
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-01-24 00:04:58 +0000
committerBrian Paul <[email protected]>2001-01-24 00:04:58 +0000
commit74b493a5e61237de081a438e774e5d8139d4c6b7 (patch)
treea8bc94a65bacc67b9b1473f91a2bd84cd2b25937 /src/mesa/array_cache
parent125fddc31dc9959901d9f1ece693b09f04426d48 (diff)
Lots of GLchan datatype changes.
Added GLvector4us datatype in math/m_vector.[ch] Added _math_trans_4us() in math/m_translate.[ch] Choose GLvector4ub, GLvector4us, GLvector4f at compile time based on CHAN_BITS. Made Driver.ClearColor() and Driver.ClearIndex() optional driver functions. Changed args to Driver.ClearColor(), updated drivers. Reordered files in Makefile.X11
Diffstat (limited to 'src/mesa/array_cache')
-rw-r--r--src/mesa/array_cache/ac_import.c82
1 files changed, 60 insertions, 22 deletions
diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c
index e6d7651170b..3c665e9d665 100644
--- a/src/mesa/array_cache/ac_import.c
+++ b/src/mesa/array_cache/ac_import.c
@@ -1,4 +1,4 @@
-/* $Id: ac_import.c,v 1.3 2001/01/16 15:25:11 brianp Exp $ */
+/* $Id: ac_import.c,v 1.4 2001/01/24 00:04:59 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -33,6 +33,7 @@
#include "mmath.h"
#include "mtypes.h"
+#include "math/m_translate.h"
#include "array_cache/ac_context.h"
#include "math/m_translate.h"
@@ -270,20 +271,39 @@ static void import_color( GLcontext *ctx,
/* Limited choices at this stage:
*/
- ASSERT(type == GL_UNSIGNED_BYTE);
- ASSERT(stride == 4*sizeof(GLubyte) || stride == 0);
+ /* XXX GLchan: is this right for GLchan? */
+ ASSERT(type == CHAN_TYPE);
+ ASSERT(stride == 4 * sizeof(GLchan) || stride == 0);
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
_math_trans_4ub( to->Ptr,
- from->Ptr,
- from->StrideB,
- from->Type,
- from->Size,
- ac->start,
- ac->count);
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ ac->start,
+ ac->count);
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ _math_trans_4us( to->Ptr,
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ ac->start,
+ ac->count);
+#elif CHAN_TYPE == GL_FLOAT
+ _math_trans_4f( to->Ptr,
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ ac->start,
+ ac->count);
+#endif
to->Size = from->Size;
- to->StrideB = 4 * sizeof(GLubyte);
- to->Type = GL_UNSIGNED_BYTE;
+ to->StrideB = 4 * sizeof(GLchan);
+ to->Type = CHAN_TYPE;
ac->Current.Color = to;
ac->Writeable.Color = GL_TRUE;
}
@@ -322,19 +342,37 @@ static void import_secondarycolor( GLcontext *ctx,
/* Limited choices at this stage:
*/
- ASSERT(type == GL_UNSIGNED_BYTE);
- ASSERT(stride == 4*sizeof(GLubyte) || stride == 0);
+ ASSERT(type == CHAN_TYPE);
+ ASSERT(stride == 4 * sizeof(GLchan) || stride == 0);
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
_math_trans_4ub( to->Ptr,
- from->Ptr,
- from->StrideB,
- from->Type,
- from->Size,
- ac->start,
- ac->count);
-
- to->StrideB = 4 * sizeof(GLubyte);
- to->Type = GL_UNSIGNED_BYTE;
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ ac->start,
+ ac->count);
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ _math_trans_4us( to->Ptr,
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ ac->start,
+ ac->count);
+#elif CHAN_TYPE == GL_FLOAT
+ _math_trans_4f( to->Ptr,
+ from->Ptr,
+ from->StrideB,
+ from->Type,
+ from->Size,
+ ac->start,
+ ac->count);
+#endif
+
+ to->StrideB = 4 * sizeof(GLchan);
+ to->Type = CHAN_TYPE;
ac->Current.SecondaryColor = to;
ac->Writeable.SecondaryColor = GL_TRUE;
}