diff options
author | Eric Anholt <[email protected]> | 2014-12-28 08:14:19 -1000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-12-30 14:33:52 -0800 |
commit | 3ba57bae47666ada1145259755fc326b1b9f9463 (patch) | |
tree | 46f2e5952485f97aa47918d50c5051f028917c7f /src/gallium/drivers/vc4/vc4_emit.c | |
parent | 0404e7fe0ac2a6234a11290b4b1596e8bc127a4b (diff) |
vc4: Only render tiles where the scissor ever intersected them.
This gives a 2.7x improvement in x11perf -rect100, since we only end up
load/storing the x11perf window, not the whole screen.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_emit.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_emit.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_emit.c b/src/gallium/drivers/vc4/vc4_emit.c index 68564410afc..d2b54fccf91 100644 --- a/src/gallium/drivers/vc4/vc4_emit.c +++ b/src/gallium/drivers/vc4/vc4_emit.c @@ -37,12 +37,19 @@ vc4_emit_state(struct pipe_context *pctx) float vp_maxy = fabs(vpscale[1]) + vptranslate[1]; uint32_t minx = MAX2(vc4->scissor.minx, vp_minx); uint32_t miny = MAX2(vc4->scissor.miny, vp_miny); + uint32_t maxx = MIN2(vc4->scissor.maxx, vp_maxx); + uint32_t maxy = MIN2(vc4->scissor.maxy, vp_maxy); cl_u8(&vc4->bcl, VC4_PACKET_CLIP_WINDOW); cl_u16(&vc4->bcl, minx); cl_u16(&vc4->bcl, miny); - cl_u16(&vc4->bcl, MIN2(vc4->scissor.maxx, vp_maxx) - minx); - cl_u16(&vc4->bcl, MIN2(vc4->scissor.maxy, vp_maxy) - miny); + cl_u16(&vc4->bcl, maxx - minx); + cl_u16(&vc4->bcl, maxy - miny); + + vc4->draw_min_x = MIN2(vc4->draw_min_x, minx); + vc4->draw_min_y = MIN2(vc4->draw_min_y, miny); + vc4->draw_max_x = MAX2(vc4->draw_max_x, maxx); + vc4->draw_max_y = MAX2(vc4->draw_max_y, maxy); } if (vc4->dirty & (VC4_DIRTY_RASTERIZER | VC4_DIRTY_ZSA)) { |