66
66
struct lp_jit_context jit_context;
68
68
/* The shader itself. Probably we also need to pass a pointer to
69
* the tile color/z/stencil data somehow:
70
* jit_function[0] skips the triangle in/out test code
71
* jit_function[1] does triangle in/out testing
69
* the tile color/z/stencil data somehow
73
lp_jit_frag_func jit_function[2];
71
struct lp_fragment_shader_variant *variant;
82
78
* These pointers point into the bin data buffer.
84
80
struct lp_rast_shader_inputs {
81
float facing; /** Positive for front-facing, negative for back-facing */
82
boolean disable:1; /** Partially binned, disable this command */
83
boolean opaque:1; /** Is opaque */
89
/* edge/step info for 3 edges and 4x4 block of pixels */
90
PIPE_ALIGN_VAR(16) int step[3][16];
89
const struct lp_rast_state *state;
93
struct lp_rast_plane {
94
/* one-pixel sized trivial accept offsets for each plane */
97
/* one-pixel sized trivial reject offsets for each plane */
100
/* edge function values at minx,miny ?? */
95
108
* Rasterization information for a triangle known to be in this bin,
96
109
* plus inputs to run the shader:
97
110
* These fields are tile- and bin-independent.
98
* Objects of this type are put into the setup_context::data buffer.
111
* Objects of this type are put into the lp_setup_context::data buffer.
100
113
struct lp_rast_triangle {
114
/* inputs for the shader */
115
struct lp_rast_shader_inputs inputs;
105
/* one-pixel sized trivial accept offsets for each plane */
110
/* one-pixel sized trivial reject offsets for each plane */
115
/* y deltas for vertex pairs (in fixed pt) */
120
/* x deltas for vertex pairs (in fixed pt) */
125
/* edge function values at minx,miny ?? */
128
/* inputs for the shader */
129
PIPE_ALIGN_VAR(16) struct lp_rast_shader_inputs inputs;
121
struct lp_rast_plane plane[8]; /* NOTE: may allocate fewer planes */
134
126
struct lp_rasterizer *
135
lp_rast_create( void );
127
lp_rast_create( unsigned num_threads );
138
130
lp_rast_destroy( struct lp_rasterizer * );
151
143
union lp_rast_cmd_arg {
152
144
const struct lp_rast_shader_inputs *shade_tile;
153
const struct lp_rast_triangle *triangle;
146
const struct lp_rast_triangle *tri;
154
149
const struct lp_rast_state *set_state;
155
150
uint8_t clear_color[4];
156
unsigned clear_zstencil;
157
155
struct lp_fence *fence;
156
struct llvmpipe_query *query_obj;
171
170
static INLINE union lp_rast_cmd_arg
172
lp_rast_arg_triangle( const struct lp_rast_triangle *triangle )
171
lp_rast_arg_triangle( const struct lp_rast_triangle *triangle,
174
174
union lp_rast_cmd_arg arg;
175
arg.triangle = triangle;
175
arg.triangle.tri = triangle;
176
arg.triangle.plane_mask = plane_mask;
196
197
static INLINE union lp_rast_cmd_arg
198
lp_rast_arg_clearzs( unsigned value, unsigned mask )
200
union lp_rast_cmd_arg arg;
201
arg.clear_zstencil.value = value;
202
arg.clear_zstencil.mask = mask;
207
static INLINE union lp_rast_cmd_arg
208
lp_rast_arg_query( struct llvmpipe_query *pq )
210
union lp_rast_cmd_arg arg;
215
static INLINE union lp_rast_cmd_arg
197
216
lp_rast_arg_null( void )
199
218
union lp_rast_cmd_arg arg;
207
225
* Binnable Commands.
208
226
* These get put into bins by the setup code and are called when
209
227
* the bins are executed.
212
void lp_rast_clear_color( struct lp_rasterizer_task *,
213
const union lp_rast_cmd_arg );
215
void lp_rast_clear_zstencil( struct lp_rasterizer_task *,
216
const union lp_rast_cmd_arg );
218
void lp_rast_load_color( struct lp_rasterizer_task *,
219
const union lp_rast_cmd_arg );
221
void lp_rast_set_state( struct lp_rasterizer_task *,
222
const union lp_rast_cmd_arg );
224
void lp_rast_triangle( struct lp_rasterizer_task *,
225
const union lp_rast_cmd_arg );
227
void lp_rast_shade_tile( struct lp_rasterizer_task *,
228
const union lp_rast_cmd_arg );
230
void lp_rast_fence( struct lp_rasterizer_task *,
231
const union lp_rast_cmd_arg );
229
#define LP_RAST_OP_CLEAR_COLOR 0x0
230
#define LP_RAST_OP_CLEAR_ZSTENCIL 0x1
231
#define LP_RAST_OP_TRIANGLE_1 0x2
232
#define LP_RAST_OP_TRIANGLE_2 0x3
233
#define LP_RAST_OP_TRIANGLE_3 0x4
234
#define LP_RAST_OP_TRIANGLE_4 0x5
235
#define LP_RAST_OP_TRIANGLE_5 0x6
236
#define LP_RAST_OP_TRIANGLE_6 0x7
237
#define LP_RAST_OP_TRIANGLE_7 0x8
238
#define LP_RAST_OP_TRIANGLE_8 0x9
239
#define LP_RAST_OP_TRIANGLE_3_16 0xa
240
#define LP_RAST_OP_SHADE_TILE 0xb
241
#define LP_RAST_OP_SHADE_TILE_OPAQUE 0xc
242
#define LP_RAST_OP_BEGIN_QUERY 0xd
243
#define LP_RAST_OP_END_QUERY 0xe
245
#define LP_RAST_OP_MAX 0xf
246
#define LP_RAST_OP_MASK 0xff
249
lp_debug_bins( struct lp_scene *scene );
251
lp_debug_draw_bins_by_cmd_length( struct lp_scene *scene );
253
lp_debug_draw_bins_by_coverage( struct lp_scene *scene );