diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_blend.c | 9 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_derived.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_rasterizer.c | 2 |
5 files changed, 20 insertions, 7 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 9ec18e8429e..62fa6a90b4d 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -69,6 +69,7 @@ struct llvmpipe_context { 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; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 2fad469d197..7f2223129aa 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -66,9 +66,6 @@ static boolean try_update_scene_state( struct lp_setup_context *setup ); 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++; @@ -84,8 +81,8 @@ lp_setup_get_empty_scene(struct lp_setup_context *setup) 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); + } diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index 6bba9077d1b..b0fc1d38124 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c @@ -177,6 +177,13 @@ static void 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 @@ -194,4 +201,6 @@ llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe) llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref; llvmpipe->pipe.set_sample_mask = llvmpipe_set_sample_mask; + + llvmpipe->sample_mask = ~0; } diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c index 5c3a3a8e3a9..a300841d395 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_derived.c +++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c @@ -185,6 +185,14 @@ void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe ) 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)) diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c index 2149ffc2351..5a0f51fe108 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c +++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c @@ -119,8 +119,6 @@ llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, void *handle) 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, |