Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
[mesa.git] / src / gallium / drivers / nv50 / nv50_draw.c
1 /*
2 * Copyright 2008 Ben Skeggs
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 */
22
23 #include "draw/draw_pipe.h"
24 #include "pipe/p_util.h"
25
26 #include "nv50_context.h"
27
28 struct nv50_render_stage {
29 struct draw_stage stage;
30 struct nv50_context *nv50;
31 };
32
33 static INLINE struct nv50_render_stage *
34 nv50_render_stage(struct draw_stage *stage)
35 {
36 return (struct nv50_render_stage *)stage;
37 }
38
39 static void
40 nv50_render_point(struct draw_stage *stage, struct prim_header *prim)
41 {
42 NOUVEAU_ERR("\n");
43 }
44
45 static void
46 nv50_render_line(struct draw_stage *stage, struct prim_header *prim)
47 {
48 NOUVEAU_ERR("\n");
49 }
50
51 static void
52 nv50_render_tri(struct draw_stage *stage, struct prim_header *prim)
53 {
54 NOUVEAU_ERR("\n");
55 }
56
57 static void
58 nv50_render_flush(struct draw_stage *stage, unsigned flags)
59 {
60 }
61
62 static void
63 nv50_render_reset_stipple_counter(struct draw_stage *stage)
64 {
65 NOUVEAU_ERR("\n");
66 }
67
68 static void
69 nv50_render_destroy(struct draw_stage *stage)
70 {
71 FREE(stage);
72 }
73
74 struct draw_stage *
75 nv50_draw_render_stage(struct nv50_context *nv50)
76 {
77 struct nv50_render_stage *rs = CALLOC_STRUCT(nv50_render_stage);
78
79 rs->nv50 = nv50;
80 rs->stage.draw = nv50->draw;
81 rs->stage.destroy = nv50_render_destroy;
82 rs->stage.point = nv50_render_point;
83 rs->stage.line = nv50_render_line;
84 rs->stage.tri = nv50_render_tri;
85 rs->stage.flush = nv50_render_flush;
86 rs->stage.reset_stipple_counter = nv50_render_reset_stipple_counter;
87
88 return &rs->stage;
89 }
90