summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_setup.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-04-14 10:56:56 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-04-14 10:57:40 -0600
commitf58ab8e75c082a0aea36ed63fe7e21fb5fac14b6 (patch)
treedfd65b11cc2babc17aa5b899c2a96bdf70d17f75 /src/gallium/drivers/softpipe/sp_setup.c
parent983b6a73e1842b436d158dc1d018bd483a1c9929 (diff)
gallium: take reduced prim, fill modes into account when culling
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_setup.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index 0164d0588d..813d703108 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -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;
+ }
}