Mesa (lp-binning): llvmpipe: fix-up polygon culling/winding

Brian Paul brianp at kemper.freedesktop.org
Fri Dec 4 13:11:45 PST 2009


Module: Mesa
Branch: lp-binning
Commit: 15a2a588d88ae02e575ff1ef9287c789ebdadead
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15a2a588d88ae02e575ff1ef9287c789ebdadead

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Dec  4 13:53:28 2009 -0700

llvmpipe: fix-up polygon culling/winding

---

 src/gallium/drivers/llvmpipe/lp_state_rasterizer.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
index 4561c6b..282ed2e 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
@@ -29,6 +29,7 @@
 #include "util/u_memory.h"
 #include "lp_context.h"
 #include "lp_state.h"
+#include "lp_setup.h"
 #include "draw/draw_context.h"
 
 
@@ -50,6 +51,16 @@ void llvmpipe_bind_rasterizer_state(struct pipe_context *pipe,
 
    llvmpipe->rasterizer = (struct pipe_rasterizer_state *)setup;
 
+   /* Note: we can immediately set the triangle state here and
+    * not worry about binning because we handle culling during
+    * triangle setup, not when rasterizing the bins.
+    */
+   if (llvmpipe->rasterizer) {
+      lp_setup_set_triangle_state( llvmpipe->setup,
+                   llvmpipe->rasterizer->cull_mode,
+                   llvmpipe->rasterizer->front_winding == PIPE_WINDING_CCW );
+   }
+
    llvmpipe->dirty |= LP_NEW_RASTERIZER;
 }
 



More information about the mesa-commit mailing list