119
124
/* unfilled polygons */
120
if (rasterizer->fill_cw != PIPE_POLYGON_MODE_FILL ||
121
rasterizer->fill_ccw != PIPE_POLYGON_MODE_FILL)
125
if (rasterizer->fill_front != PIPE_POLYGON_MODE_FILL ||
126
rasterizer->fill_back != PIPE_POLYGON_MODE_FILL)
124
129
/* polygon offset */
125
if (rasterizer->offset_cw || rasterizer->offset_ccw)
130
if (rasterizer->offset_point ||
131
rasterizer->offset_line ||
132
rasterizer->offset_tri)
128
135
/* two-side lighting */
154
161
boolean need_det = FALSE;
155
162
boolean precalc_flat = FALSE;
156
163
boolean wide_lines, wide_points;
164
const struct pipe_rasterizer_state *rast = draw->rasterizer;
158
166
/* Set the validate's next stage to the rasterize stage, so that it
159
167
* can be found later if needed for flushing.
161
169
stage->next = next;
163
171
/* drawing wide lines? */
164
wide_lines = (draw->rasterizer->line_width > draw->pipeline.wide_line_threshold
165
&& !draw->rasterizer->line_smooth);
172
wide_lines = (rast->line_width > draw->pipeline.wide_line_threshold
173
&& !rast->line_smooth);
167
175
/* drawing large points? */
168
if (draw->rasterizer->sprite_coord_enable && draw->pipeline.point_sprite)
176
if (rast->sprite_coord_enable && draw->pipeline.point_sprite)
169
177
wide_points = TRUE;
170
else if (draw->rasterizer->point_smooth && draw->pipeline.aapoint)
178
else if (rast->point_smooth && draw->pipeline.aapoint)
171
179
wide_points = FALSE;
172
else if (draw->rasterizer->point_size > draw->pipeline.wide_point_threshold)
180
else if (rast->point_size > draw->pipeline.wide_point_threshold)
182
else if (rast->point_quad_rasterization && draw->pipeline.wide_point_sprites)
173
183
wide_points = TRUE;
175
185
wide_points = FALSE;
181
191
* shorter pipelines for lines & points.
184
if (draw->rasterizer->line_smooth && draw->pipeline.aaline) {
194
if (rast->line_smooth && draw->pipeline.aaline) {
185
195
draw->pipeline.aaline->next = next;
186
196
next = draw->pipeline.aaline;
189
if (draw->rasterizer->point_smooth && draw->pipeline.aapoint) {
199
if (rast->point_smooth && draw->pipeline.aapoint) {
190
200
draw->pipeline.aapoint->next = next;
191
201
next = draw->pipeline.aapoint;
197
207
precalc_flat = TRUE;
200
if (wide_points || draw->rasterizer->sprite_coord_enable) {
210
if (wide_points || rast->sprite_coord_enable) {
201
211
draw->pipeline.wide_point->next = next;
202
212
next = draw->pipeline.wide_point;
205
if (draw->rasterizer->line_stipple_enable && draw->pipeline.line_stipple) {
215
if (rast->line_stipple_enable && draw->pipeline.line_stipple) {
206
216
draw->pipeline.stipple->next = next;
207
217
next = draw->pipeline.stipple;
208
218
precalc_flat = TRUE; /* only needed for lines really */
211
if (draw->rasterizer->poly_stipple_enable
221
if (rast->poly_stipple_enable
212
222
&& draw->pipeline.pstipple) {
213
223
draw->pipeline.pstipple->next = next;
214
224
next = draw->pipeline.pstipple;
217
if (draw->rasterizer->fill_cw != PIPE_POLYGON_MODE_FILL ||
218
draw->rasterizer->fill_ccw != PIPE_POLYGON_MODE_FILL) {
227
if (rast->fill_front != PIPE_POLYGON_MODE_FILL ||
228
rast->fill_back != PIPE_POLYGON_MODE_FILL) {
219
229
draw->pipeline.unfilled->next = next;
220
230
next = draw->pipeline.unfilled;
221
231
precalc_flat = TRUE; /* only needed for triangles really */
225
if (draw->rasterizer->flatshade && precalc_flat) {
235
if (rast->flatshade && precalc_flat) {
226
236
draw->pipeline.flatshade->next = next;
227
237
next = draw->pipeline.flatshade;
230
if (draw->rasterizer->offset_cw ||
231
draw->rasterizer->offset_ccw) {
240
if (rast->offset_point ||
232
243
draw->pipeline.offset->next = next;
233
244
next = draw->pipeline.offset;
237
if (draw->rasterizer->light_twoside) {
248
if (rast->light_twoside) {
238
249
draw->pipeline.twoside->next = next;
239
250
next = draw->pipeline.twoside;
247
258
* to less work emitting vertices, smaller vertex buffers, etc.
248
259
* It's difficult to say whether this will be true in general.
250
if (need_det || draw->rasterizer->cull_mode) {
261
if (need_det || rast->cull_face != PIPE_FACE_NONE) {
251
262
draw->pipeline.cull->next = next;
252
263
next = draw->pipeline.cull;
257
if (!draw->bypass_clipping)
268
if (draw->clip_xy || draw->clip_z || draw->clip_user)
259
270
draw->pipeline.clip->next = next;
260
271
next = draw->pipeline.clip;