Remove CVS keywords.
[mesa.git] / src / mesa / drivers / dri / ffb / ffb_points.c
1 /*
2 *
3 * GLX Hardware Device Driver for Sun Creator/Creator3D
4 * Copyright (C) 2000, 2001 David S. Miller
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 *
25 * David S. Miller <davem@redhat.com>
26 */
27
28 #include "main/mtypes.h"
29 #include "ffb_dd.h"
30 #include "ffb_context.h"
31 #include "ffb_vb.h"
32 #include "ffb_points.h"
33 #include "ffb_tris.h"
34 #include "ffb_lock.h"
35
36
37 #undef FFB_POINT_TRACE
38
39 #define FFB_POINT_AA_BIT 0x01
40
41 static ffb_point_func ffb_point_tab[0x08];
42
43 #define IND (0)
44 #define TAG(x) x
45 #include "ffb_pointtmp.h"
46
47 #define IND (FFB_POINT_AA_BIT)
48 #define TAG(x) x##_aa
49 #include "ffb_pointtmp.h"
50
51 void ffbDDPointfuncInit(void)
52 {
53 init();
54 init_aa();
55 }
56
57 static void ffb_dd_points( GLcontext *ctx, GLuint first, GLuint last )
58 {
59 struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb;
60 ffbContextPtr fmesa = FFB_CONTEXT(ctx);
61 ffb_vertex *fverts = fmesa->verts;
62 int i;
63
64 if (VB->Elts == 0) {
65 for ( i = first ; i < last ; i++ ) {
66 if ( VB->ClipMask[i] == 0 ) {
67 fmesa->draw_point( ctx, &fverts[i] );
68 }
69 }
70 } else {
71 for ( i = first ; i < last ; i++ ) {
72 GLuint e = VB->Elts[i];
73 if ( VB->ClipMask[e] == 0 ) {
74 fmesa->draw_point( ctx, &fverts[e] );
75 }
76 }
77 }
78 }
79
80 void ffbChoosePointState(GLcontext *ctx)
81 {
82 ffbContextPtr fmesa = FFB_CONTEXT(ctx);
83 TNLcontext *tnl = TNL_CONTEXT(ctx);
84 GLuint flags = ctx->_TriangleCaps;
85 GLuint ind = 0;
86
87 tnl->Driver.Render.Points = ffb_dd_points;
88
89 if (flags & DD_POINT_SMOOTH)
90 ind |= FFB_POINT_AA_BIT;
91
92 fmesa->draw_point = ffb_point_tab[ind];
93 }