summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-04-19 08:35:53 -0600
committerBrian Paul <brianp@vmware.com>2010-04-19 08:35:53 -0600
commite3a34cc7f6c9f959cdc2af4486e84587fab4d0d7 (patch)
tree437667e2b7da27f03c190bee6b67bff260af0733 /src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
parentdb3b34219ef1dbf9ebf5e524d3e459f9ad9571b5 (diff)
gallium/draw: use correct rasterization state for wide/AA points/lines
When points or lines are decomposed into triangles, we need to be sure to disable polygon culling, stippling, "un-filled" modes, etc. This patch sets the rasterization state to disable those things prior to drawing points/lines with triangles, then restores the previous state afterward. The new piglit point-no-line-cull test checks this problem & solution.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_rasterizer.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_rasterizer.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
index feb012816c..8592da0d9d 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
@@ -38,19 +38,26 @@ void *
llvmpipe_create_rasterizer_state(struct pipe_context *pipe,
const struct pipe_rasterizer_state *rast)
{
+ /* We do nothing special with rasterizer state.
+ * The CSO handle is just a pointer to a pipe_rasterizer_state object.
+ */
return mem_dup(rast, sizeof(*rast));
}
-void llvmpipe_bind_rasterizer_state(struct pipe_context *pipe,
- void *rasterizer)
+
+
+void
+llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, void *handle)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+ const struct pipe_rasterizer_state *rasterizer =
+ (const struct pipe_rasterizer_state *) handle;
if (llvmpipe->rasterizer == rasterizer)
return;
/* pass-through to draw module */
- draw_set_rasterizer_state(llvmpipe->draw, rasterizer);
+ draw_set_rasterizer_state(llvmpipe->draw, rasterizer, handle);
llvmpipe->rasterizer = rasterizer;
@@ -68,6 +75,7 @@ void llvmpipe_bind_rasterizer_state(struct pipe_context *pipe,
llvmpipe->dirty |= LP_NEW_RASTERIZER;
}
+
void llvmpipe_delete_rasterizer_state(struct pipe_context *pipe,
void *rasterizer)
{