diff options
author | Carl Worth <[email protected]> | 2015-02-23 14:44:39 -0800 |
---|---|---|
committer | Carl Worth <[email protected]> | 2015-04-02 22:15:45 -0700 |
commit | 28510d69ff8fc03bc1693be2b7a02bc68791dd2f (patch) | |
tree | 304866baff986c35ac451f0bc7419add6cc637e4 /src/mesa/drivers/dri/i965/brw_gs.c | |
parent | 01d3b750b3682f3774f1bd01fa07a6b3c8baf28e (diff) |
i965: Split out brw_<stage>_populate_key into their own functions
This commit splits portions of the existing brw_upload_vs_prog and
brw_upload_gs_prog function into new brw_vs_populate_key and
brw_gs_populate_key functions. This follows the same style as is
already present for all other stages, (see brw_wm_populate_key, etc.).
This commit is intended to have no functional change. It exists in
preparation for some upcoming code movement in preparation for the
shader cache.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_gs.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_gs.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index ffe74768253..e2330499ea0 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -288,6 +288,30 @@ do_gs_prog(struct brw_context *brw, return true; } +static void +brw_gs_populate_key(struct brw_context *brw, + struct brw_gs_prog_key *key) +{ + struct gl_context *ctx = &brw->ctx; + struct brw_stage_state *stage_state = &brw->gs.base; + struct brw_geometry_program *gp = + (struct brw_geometry_program *) brw->geometry_program; + struct gl_program *prog = &gp->program.Base; + + memset(key, 0, sizeof(*key)); + + key->base.program_string_id = gp->id; + brw_setup_vue_key_clip_info(brw, &key->base, + gp->program.Base.UsesClipDistanceOut); + + /* _NEW_TEXTURE */ + brw_populate_sampler_prog_key_data(ctx, prog, stage_state->sampler_count, + &key->base.tex); + + /* BRW_NEW_VUE_MAP_VS */ + key->input_varyings = brw->vue_map_vs.slots_valid; +} + void brw_upload_gs_prog(struct brw_context *brw) { @@ -327,20 +351,7 @@ brw_upload_gs_prog(struct brw_context *brw) return; } - struct gl_program *prog = &gp->program.Base; - - memset(&key, 0, sizeof(key)); - - key.base.program_string_id = gp->id; - brw_setup_vue_key_clip_info(brw, &key.base, - gp->program.Base.UsesClipDistanceOut); - - /* _NEW_TEXTURE */ - brw_populate_sampler_prog_key_data(ctx, prog, stage_state->sampler_count, - &key.base.tex); - - /* BRW_NEW_VUE_MAP_VS */ - key.input_varyings = brw->vue_map_vs.slots_valid; + brw_gs_populate_key(brw, &key); if (!brw_search_cache(&brw->cache, BRW_CACHE_GS_PROG, &key, sizeof(key), |