diff options
author | Eric Anholt <[email protected]> | 2014-05-06 16:37:05 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-10-24 23:17:14 -0700 |
commit | 08599f668c5d991ab19376a19cb2e14e5245db95 (patch) | |
tree | d1b915c451aaf4488968275ebfbc4d74d79214c9 /src/mesa/drivers/dri/i965/gen7_urb.c | |
parent | b0e0c26f0214739108dbf0d6ae9596caf13287ee (diff) |
i965: Skip recalculating URB allocations if the entry size didn't change.
We only get here if the VS/GS compiled programs change, but we can even
skip it if the VS/GS size didn't change.
Affects cairo runtime on glamor by -1.26471% +/- 0.674335% (n=234)
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_urb.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_urb.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_urb.c b/src/mesa/drivers/dri/i965/gen7_urb.c index 190d6f07493..eb3784a846b 100644 --- a/src/mesa/drivers/dri/i965/gen7_urb.c +++ b/src/mesa/drivers/dri/i965/gen7_urb.c @@ -150,6 +150,19 @@ gen7_upload_urb(struct brw_context *brw) unsigned gs_size = gs_present ? brw->gs.prog_data->base.urb_entry_size : 1; unsigned gs_entry_size_bytes = gs_size * 64; + /* If we're just switching between programs with the same URB requirements, + * skip the rest of the logic. + */ + if (!(brw->state.dirty.brw & BRW_NEW_CONTEXT) && + brw->urb.vsize == vs_size && + brw->urb.gs_present == gs_present && + brw->urb.gsize == gs_size) { + return; + } + brw->urb.vsize = vs_size; + brw->urb.gs_present = gs_present; + brw->urb.gsize = gs_size; + /* From p35 of the Ivy Bridge PRM (section 1.7.1: 3DSTATE_URB_GS): * * VS Number of URB Entries must be divisible by 8 if the VS URB Entry |