1 /* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.c,v 1.2 2002/02/22 21:32:59 dawes Exp $
3 * GLX Hardware Device Driver for Sun Creator/Creator3D
4 * Copyright (C) 2000, 2001 David S. Miller
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:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
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.
25 * David S. Miller <davem@redhat.com>
30 #include "ffb_context.h"
32 #include "ffb_points.h"
37 #undef FFB_POINT_TRACE
39 #define FFB_POINT_AA_BIT 0x01
41 static ffb_point_func ffb_point_tab
[0x08];
45 #include "ffb_pointtmp.h"
47 #define IND (FFB_POINT_AA_BIT)
49 #include "ffb_pointtmp.h"
51 void ffbDDPointfuncInit(void)
57 static void ffb_dd_points( GLcontext
*ctx
, GLuint first
, GLuint last
)
59 struct vertex_buffer
*VB
= &TNL_CONTEXT( ctx
)->vb
;
60 ffbContextPtr fmesa
= FFB_CONTEXT(ctx
);
61 ffb_vertex
*fverts
= fmesa
->verts
;
65 for ( i
= first
; i
< last
; i
++ ) {
66 if ( VB
->ClipMask
[i
] == 0 ) {
67 fmesa
->draw_point( ctx
, &fverts
[i
] );
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
] );
80 void ffbChoosePointState(GLcontext
*ctx
)
82 ffbContextPtr fmesa
= FFB_CONTEXT(ctx
);
83 TNLcontext
*tnl
= TNL_CONTEXT(ctx
);
84 GLuint flags
= ctx
->_TriangleCaps
;
87 tnl
->Driver
.Render
.Points
= ffb_dd_points
;
89 if (flags
& DD_POINT_SMOOTH
)
90 ind
|= FFB_POINT_AA_BIT
;
92 fmesa
->draw_point
= ffb_point_tab
[ind
];