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>
28 #include "main/mtypes.h"
30 #include "ffb_context.h"
32 #include "ffb_points.h"
35 #undef FFB_POINT_TRACE
37 #define FFB_POINT_AA_BIT 0x01
39 static ffb_point_func ffb_point_tab
[0x08];
43 #include "ffb_pointtmp.h"
45 #define IND (FFB_POINT_AA_BIT)
47 #include "ffb_pointtmp.h"
49 void ffbDDPointfuncInit(void)
55 static void ffb_dd_points( GLcontext
*ctx
, GLuint first
, GLuint last
)
57 struct vertex_buffer
*VB
= &TNL_CONTEXT( ctx
)->vb
;
58 ffbContextPtr fmesa
= FFB_CONTEXT(ctx
);
59 ffb_vertex
*fverts
= fmesa
->verts
;
63 for ( i
= first
; i
< last
; i
++ ) {
64 if ( VB
->ClipMask
[i
] == 0 ) {
65 fmesa
->draw_point( ctx
, &fverts
[i
] );
69 for ( i
= first
; i
< last
; i
++ ) {
70 GLuint e
= VB
->Elts
[i
];
71 if ( VB
->ClipMask
[e
] == 0 ) {
72 fmesa
->draw_point( ctx
, &fverts
[e
] );
78 void ffbChoosePointState(GLcontext
*ctx
)
80 ffbContextPtr fmesa
= FFB_CONTEXT(ctx
);
81 TNLcontext
*tnl
= TNL_CONTEXT(ctx
);
82 GLuint flags
= ctx
->_TriangleCaps
;
85 tnl
->Driver
.Render
.Points
= ffb_dd_points
;
87 if (flags
& DD_POINT_SMOOTH
)
88 ind
|= FFB_POINT_AA_BIT
;
90 fmesa
->draw_point
= ffb_point_tab
[ind
];