diff options
author | Jordan Justen <[email protected]> | 2018-02-28 17:58:02 -0800 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2018-07-09 23:02:33 -0700 |
commit | 36dd15f8b337e6a864d736ba502b8aa3d0ae6e4f (patch) | |
tree | 7b5ffb0bf1941b8c348f8bb04d1cfd3caffa434d /src/mesa/drivers/dri/i965/brw_vs.c | |
parent | 65f2014740eb26c1b740dab435b9964e4bdb1164 (diff) |
i965: Add brw_populate_default_key
We will need to populate the default key for ARB_get_program_binary to
allow us to retrieve the default gen program to store in the program
binary.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index f024c33c02d..21e75664ae9 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -356,6 +356,23 @@ brw_upload_vs_prog(struct brw_context *brw) assert(success); } +void +brw_vs_populate_default_key(const struct gen_device_info *devinfo, + struct brw_vs_prog_key *key, + struct gl_program *prog) +{ + struct brw_program *bvp = brw_program(prog); + + memset(key, 0, sizeof(*key)); + + brw_setup_tex_for_precompile(devinfo, &key->tex, prog); + key->program_string_id = bvp->id; + key->clamp_vertex_color = + (prog->info.outputs_written & + (VARYING_BIT_COL0 | VARYING_BIT_COL1 | VARYING_BIT_BFC0 | + VARYING_BIT_BFC1)); +} + bool brw_vs_precompile(struct gl_context *ctx, struct gl_program *prog) { @@ -367,14 +384,7 @@ brw_vs_precompile(struct gl_context *ctx, struct gl_program *prog) struct brw_program *bvp = brw_program(prog); - memset(&key, 0, sizeof(key)); - - brw_setup_tex_for_precompile(&brw->screen->devinfo, &key.tex, prog); - key.program_string_id = bvp->id; - key.clamp_vertex_color = - (prog->info.outputs_written & - (VARYING_BIT_COL0 | VARYING_BIT_COL1 | VARYING_BIT_BFC0 | - VARYING_BIT_BFC1)); + brw_vs_populate_default_key(&brw->screen->devinfo, &key, prog); success = brw_codegen_vs_prog(brw, bvp, &key); |