diff options
author | Roland Scheidegger <[email protected]> | 2018-05-22 02:12:38 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2018-05-23 04:23:32 +0200 |
commit | 7b89fcec416ed7e6ddadec2438aab63609d825f8 (patch) | |
tree | 8dc8b63863c719844eee42f47721a408d85f6c2b /src/gallium/drivers/llvmpipe/lp_setup_line.c | |
parent | 047438287c4ddb77a6affed08da2f19bd5949b4d (diff) |
llvmpipe: improve rasterization discard logic
This unifies the explicit rasterization discard as well as the implicit
rasterization disabled logic (which we need for another state tracker),
which really should do the exact same thing.
We'll now toss out the prims early on in setup with (implicit or
explicit) discard, rather than do setup and binning with them, which
was entirely pointless.
(We should eventually get rid of implicit discard, which should also
enable us to discard stuff already in draw, hence draw would be
able to skip the pointless clip and fallback stages in this case.)
We still need separate logic for only null ps - this is not the same
as rasterization discard. But simplify the logic there and don't count
primitives simply when there's an empty fs, regardless of depth/stencil
tests, which seems perfectly acceptable by d3d10.
While here, also fix statistics for primitives if face culling is
enabled.
No piglit changes.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_line.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_line.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_line.c b/src/gallium/drivers/llvmpipe/lp_setup_line.c index d0bac5efb99..c1d8237a8ac 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_line.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_line.c @@ -616,8 +616,7 @@ try_setup_line( struct lp_setup_context *setup, LP_COUNT(nr_tris); - if (lp_context->active_statistics_queries && - !llvmpipe_rasterization_disabled(lp_context)) { + if (lp_context->active_statistics_queries) { lp_context->pipeline_statistics.c_primitives++; } @@ -759,24 +758,33 @@ try_setup_line( struct lp_setup_context *setup, } -static void lp_setup_line( struct lp_setup_context *setup, - const float (*v0)[4], - const float (*v1)[4] ) +static void lp_setup_line_discard(struct lp_setup_context *setup, + const float (*v0)[4], + const float (*v1)[4]) { - if (!try_setup_line( setup, v0, v1 )) - { +} + +static void lp_setup_line(struct lp_setup_context *setup, + const float (*v0)[4], + const float (*v1)[4]) +{ + if (!try_setup_line(setup, v0, v1)) { if (!lp_setup_flush_and_restart(setup)) return; - if (!try_setup_line( setup, v0, v1 )) + if (!try_setup_line(setup, v0, v1)) return; } } -void lp_setup_choose_line( struct lp_setup_context *setup ) +void lp_setup_choose_line(struct lp_setup_context *setup) { - setup->line = lp_setup_line; + if (setup->rasterizer_discard) { + setup->line = lp_setup_line_discard; + } else { + setup->line = lp_setup_line; + } } |