diff options
author | Carl Worth <[email protected]> | 2015-02-11 13:53:31 -0800 |
---|---|---|
committer | Carl Worth <[email protected]> | 2015-02-23 14:54:15 -0800 |
commit | 4a6c6c49a7236b1471df143a697195f0c11eb23c (patch) | |
tree | fd48d43807ecd2ed00b414937b51cc1650321d2a /src/mesa/drivers/dri/i965/brw_ff_gs.c | |
parent | 1e96eece300bbd2dd621a4941a4418222bb4c8e5 (diff) |
i965: Perform program state upload outside of atom handling
Across the board of the various generations, the intial few atoms in
all of the atom lists are basically the same, (performing uploads for
the various programs). The only difference is that prior to gen6
there's an ff_gs upload in place of the later gs upload.
In this commit, instead of using the atom lists for this program state
upload, we add a new function brw_upload_programs that calls into the
per-stage upload functions which in turn check dirty bits and return
immediately if nothing needs to be done.
This commit is intended to have no functional change. The motivation
is that future code, (such as the shader cache), wants to have a
single function within which to perform various operations before and
after program upload, (with some local variables holding state across
the upload).
It may be worth looking at whether some of the other functionality
currently handled via atoms might also be more cleanly handled in a
similar fashion.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_ff_gs.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_ff_gs.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_ff_gs.c b/src/mesa/drivers/dri/i965/brw_ff_gs.c index 653c4b6deb3..828e383bbd4 100644 --- a/src/mesa/drivers/dri/i965/brw_ff_gs.c +++ b/src/mesa/drivers/dri/i965/brw_ff_gs.c @@ -221,10 +221,18 @@ static void populate_key(struct brw_context *brw, /* Calculate interpolants for triangle and line rasterization. */ -static void +void brw_upload_ff_gs_prog(struct brw_context *brw) { struct brw_ff_gs_prog_key key; + + if (!brw_state_dirty(brw, + _NEW_LIGHT, + BRW_NEW_PRIMITIVE | + BRW_NEW_TRANSFORM_FEEDBACK | + BRW_NEW_VS_PROG_DATA)) + return; + /* Populate the key: */ populate_key(brw, &key); @@ -247,13 +255,3 @@ void gen6_brw_upload_ff_gs_prog(struct brw_context *brw) { brw_upload_ff_gs_prog(brw); } - -const struct brw_tracked_state brw_ff_gs_prog = { - .dirty = { - .mesa = _NEW_LIGHT, - .brw = BRW_NEW_PRIMITIVE | - BRW_NEW_TRANSFORM_FEEDBACK | - BRW_NEW_VS_PROG_DATA, - }, - .emit = brw_upload_ff_gs_prog -}; |