2 * Copyright 2008 Ben Skeggs
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:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
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
23 #include "draw/draw_pipe.h"
25 #include "nvc0_context.h"
27 struct nvc0_render_stage
{
28 struct draw_stage stage
;
29 struct nvc0_context
*nvc0
;
32 static INLINE
struct nvc0_render_stage
*
33 nvc0_render_stage(struct draw_stage
*stage
)
35 return (struct nvc0_render_stage
*)stage
;
39 nvc0_render_point(struct draw_stage
*stage
, struct prim_header
*prim
)
45 nvc0_render_line(struct draw_stage
*stage
, struct prim_header
*prim
)
51 nvc0_render_tri(struct draw_stage
*stage
, struct prim_header
*prim
)
57 nvc0_render_flush(struct draw_stage
*stage
, unsigned flags
)
62 nvc0_render_reset_stipple_counter(struct draw_stage
*stage
)
68 nvc0_render_destroy(struct draw_stage
*stage
)
74 nvc0_draw_render_stage(struct nvc0_context
*nvc0
)
76 struct nvc0_render_stage
*rs
= CALLOC_STRUCT(nvc0_render_stage
);
79 rs
->stage
.draw
= nvc0
->draw
;
80 rs
->stage
.destroy
= nvc0_render_destroy
;
81 rs
->stage
.point
= nvc0_render_point
;
82 rs
->stage
.line
= nvc0_render_line
;
83 rs
->stage
.tri
= nvc0_render_tri
;
84 rs
->stage
.flush
= nvc0_render_flush
;
85 rs
->stage
.reset_stipple_counter
= nvc0_render_reset_stipple_counter
;