5 /* Initially create and program a single rasterizer directly. Later
6 * will want multiple of these, one or two per core. At that stage
7 * will probably pass command buffers into the rasterizers rather than
8 * individual function calls like this.
12 struct lp_rast_state
{
13 /* State for the shader:
15 struct lp_jit_context jc
;
17 /* The shader itself. Probably we also need to pass a pointer to
18 * the tile color/z/stencil data somehow:
20 lp_jit_frag_func shader
;
24 /* Coefficients necessary to run the shader at a given location:
26 struct lp_rast_shader_inputs
{
28 /* Current rasterizer state:
30 const struct lp_rast_state
*state
;
32 /* Attribute interpolation:
34 struct tgsi_interp_coef position_coef
;
35 struct tgsi_interp_coef
*coef
;
39 /* Rasterization information for a triangle known to be in this bin,
40 * plus inputs to run the shader:
42 struct lp_rast_triangle
{
43 /* one-pixel sized trivial accept offsets for each plane */
48 /* one-pixel sized trivial reject offsets for each plane */
53 /* y deltas for vertex pairs */
58 /* x deltas for vertex pairs */
63 /* State to run the shader: */
64 struct lp_rast_shader_inputs inputs
;
69 struct lp_rasterizer
*lp_rast_create( void );
71 void lp_rast_bind_surfaces( struct lp_rasterizer
*,
72 struct pipe_surface
*color
,
73 struct pipe_surface
*zstencil
,
74 const float *clear_color
,
76 unsigned clear_stencil
);
78 /* Begining of each tile:
80 void lp_rast_start_tile( struct lp_rasterizer
*,
86 union lp_rast_cmd_arg
{
87 const struct lp_rast_shader_inputs
*shade_tile
;
88 const struct lp_rast_triangle
*triangle
;
89 const struct lp_rast_state
*set_state
;
95 void lp_rast_clear_color( struct lp_rasterizer
*,
96 const union lp_rast_cmd_arg
*);
98 void lp_rast_clear_zstencil( struct lp_rasterizer
*,
99 const union lp_rast_cmd_arg
*);
101 void lp_rast_load_color( struct lp_rasterizer
*,
102 const union lp_rast_cmd_arg
*);
104 void lp_rast_load_zstencil( struct lp_rasterizer
*,
105 const union lp_rast_cmd_arg
*);
107 void lp_rast_set_state( struct lp_rasterizer
*,
108 const union lp_rast_cmd_arg
* );
110 void lp_rast_triangle( struct lp_rasterizer
*,
111 const union lp_rast_cmd_arg
* );
113 void lp_rast_shade_tile( struct lp_rasterizer
*,
114 const union lp_rast_cmd_arg
* );
116 void lp_rast_store_color( struct lp_rasterizer
*,
117 const union lp_rast_cmd_arg
*);
119 void lp_rast_store_zstencil( struct lp_rasterizer
*,
120 const union lp_rast_cmd_arg
*);
125 void lp_rast_destroy( struct lp_rasterizer
* );