const struct lp_so_state *so;
/** Other rendering state */
+ unsigned sample_mask;
struct pipe_blend_color blend_color;
struct pipe_stencil_ref stencil_ref;
struct pipe_clip_state clip;
static void
lp_setup_get_empty_scene(struct lp_setup_context *setup)
{
- struct llvmpipe_context *lp = llvmpipe_context(setup->pipe);
- boolean discard = lp->rasterizer ? lp->rasterizer->rasterizer_discard : FALSE;
-
assert(setup->scene == NULL);
setup->scene_idx++;
lp_fence_wait(setup->scene->fence);
}
- lp_scene_begin_binning(setup->scene, &setup->fb, discard);
-
+ lp_scene_begin_binning(setup->scene, &setup->fb, setup->rasterizer_discard);
+
}
llvmpipe_set_sample_mask(struct pipe_context *pipe,
unsigned sample_mask)
{
+ struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+
+ if (sample_mask != llvmpipe->sample_mask) {
+ llvmpipe->sample_mask = sample_mask;
+
+ llvmpipe->dirty |= LP_NEW_RASTERIZER;
+ }
}
void
llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref;
llvmpipe->pipe.set_sample_mask = llvmpipe_set_sample_mask;
+
+ llvmpipe->sample_mask = ~0;
}
LP_NEW_OCCLUSION_QUERY))
llvmpipe_update_fs( llvmpipe );
+ if (llvmpipe->dirty & (LP_NEW_RASTERIZER)) {
+ boolean discard =
+ (llvmpipe->sample_mask & 1) == 0 ||
+ (llvmpipe->rasterizer ? llvmpipe->rasterizer->rasterizer_discard : FALSE);
+
+ lp_setup_set_rasterizer_discard(llvmpipe->setup, discard);
+ }
+
if (llvmpipe->dirty & (LP_NEW_FS |
LP_NEW_FRAMEBUFFER |
LP_NEW_RASTERIZER))
state->lp_state.bottom_edge_rule);
lp_setup_set_flatshade_first( llvmpipe->setup,
state->lp_state.flatshade_first);
- lp_setup_set_rasterizer_discard( llvmpipe->setup,
- state->lp_state.rasterizer_discard);
lp_setup_set_line_state( llvmpipe->setup,
state->lp_state.line_width);
lp_setup_set_point_state( llvmpipe->setup,