mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 19:30:11 +01:00
gallium: take reduced prim, fill modes into account when culling
This commit is contained in:
parent
983b6a73e1
commit
f58ab8e75c
3 changed files with 27 additions and 1 deletions
|
|
@ -105,6 +105,8 @@ struct softpipe_context {
|
|||
|
||||
int psize_slot;
|
||||
|
||||
unsigned reduced_api_prim; /**< PIPE_PRIM_POINTS, _LINES or _TRIANGLES */
|
||||
|
||||
#if 0
|
||||
/* Stipple derived state:
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -78,6 +78,20 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp)
|
|||
}
|
||||
|
||||
|
||||
static unsigned reduced_prim[PIPE_PRIM_POLYGON + 1] = {
|
||||
PIPE_PRIM_POINTS,
|
||||
PIPE_PRIM_LINES,
|
||||
PIPE_PRIM_LINES,
|
||||
PIPE_PRIM_LINES,
|
||||
PIPE_PRIM_TRIANGLES,
|
||||
PIPE_PRIM_TRIANGLES,
|
||||
PIPE_PRIM_TRIANGLES,
|
||||
PIPE_PRIM_TRIANGLES,
|
||||
PIPE_PRIM_TRIANGLES,
|
||||
PIPE_PRIM_TRIANGLES
|
||||
};
|
||||
|
||||
|
||||
boolean
|
||||
softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
|
|
@ -115,6 +129,7 @@ softpipe_draw_elements(struct pipe_context *pipe,
|
|||
assert(0);
|
||||
#endif
|
||||
|
||||
sp->reduced_api_prim = reduced_prim[mode];
|
||||
|
||||
if (sp->dirty)
|
||||
softpipe_update_derived( sp );
|
||||
|
|
|
|||
|
|
@ -1254,7 +1254,16 @@ void setup_prepare( struct setup_context *setup )
|
|||
sp->quad.first->begin(sp->quad.first);
|
||||
}
|
||||
|
||||
setup->winding = sp->rasterizer->cull_mode;
|
||||
if (sp->reduced_api_prim == PIPE_PRIM_TRIANGLES &&
|
||||
sp->rasterizer->fill_cw == PIPE_POLYGON_MODE_FILL &&
|
||||
sp->rasterizer->fill_ccw == PIPE_POLYGON_MODE_FILL) {
|
||||
/* we'll do culling */
|
||||
setup->winding = sp->rasterizer->cull_mode;
|
||||
}
|
||||
else {
|
||||
/* 'draw' will do culling */
|
||||
setup->winding = PIPE_WINDING_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue