diff options
author | Timothy Arceri <[email protected]> | 2016-10-19 11:08:18 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-10-26 14:29:36 +1100 |
commit | e6cecb837d26fce5392be87ad074f9bcbf27b47e (patch) | |
tree | 2e0376b59bde662ea1fa5710122dd6540a04a5ef /src/mesa/drivers | |
parent | 9d2b391165e64f3c64021e5a563037e0ccc09d84 (diff) |
i965: switch tcs over to shared shader_info
Note we access shader_info from the program struct rather than the
nir_shader pointer because shader cache won't create a nir_shader.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_tcs.c | 19 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_tes.c | 20 |
2 files changed, 17 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c index 0f03fab02a0..20ea4f1d57c 100644 --- a/src/mesa/drivers/dri/i965/brw_tcs.c +++ b/src/mesa/drivers/dri/i965/brw_tcs.c @@ -316,24 +316,21 @@ void brw_tcs_populate_key(struct brw_context *brw, struct brw_tcs_prog_key *key) { - uint64_t per_vertex_slots = - brw->tess_eval_program->Base.nir->info->inputs_read; - uint32_t per_patch_slots = - brw->tess_eval_program->Base.nir->info->patch_inputs_read; - struct brw_tess_ctrl_program *tcp = (struct brw_tess_ctrl_program *) brw->tess_ctrl_program; struct brw_tess_eval_program *tep = (struct brw_tess_eval_program *) brw->tess_eval_program; struct gl_program *prog = &tcp->program.Base; + struct gl_program *tes_prog = &tep->program.Base; + + uint64_t per_vertex_slots = tes_prog->info.inputs_read; + uint32_t per_patch_slots = tes_prog->info.patch_inputs_read; memset(key, 0, sizeof(*key)); - if (brw->tess_ctrl_program) { - per_vertex_slots |= - brw->tess_ctrl_program->Base.nir->info->outputs_written; - per_patch_slots |= - brw->tess_ctrl_program->Base.nir->info->patch_outputs_written; + if (tcp) { + per_vertex_slots |= prog->info.outputs_written; + per_patch_slots |= prog->info.patch_outputs_written; } if (brw->gen < 8 || !tcp) @@ -355,7 +352,7 @@ brw_tcs_populate_key(struct brw_context *brw, /* _NEW_TEXTURE */ brw_populate_sampler_prog_key_data(&brw->ctx, prog, &key->tex); } else { - key->outputs_written = tep->program.Base.nir->info->inputs_read; + key->outputs_written = tes_prog->info.inputs_read; } } diff --git a/src/mesa/drivers/dri/i965/brw_tes.c b/src/mesa/drivers/dri/i965/brw_tes.c index 59e4d50f490..3f01c07dffb 100644 --- a/src/mesa/drivers/dri/i965/brw_tes.c +++ b/src/mesa/drivers/dri/i965/brw_tes.c @@ -233,16 +233,15 @@ void brw_tes_populate_key(struct brw_context *brw, struct brw_tes_prog_key *key) { - - uint64_t per_vertex_slots = - brw->tess_eval_program->Base.nir->info->inputs_read; - uint32_t per_patch_slots = - brw->tess_eval_program->Base.nir->info->patch_inputs_read; - + struct brw_tess_ctrl_program *tcp = + (struct brw_tess_ctrl_program *) brw->tess_ctrl_program; struct brw_tess_eval_program *tep = (struct brw_tess_eval_program *) brw->tess_eval_program; struct gl_program *prog = &tep->program.Base; + uint64_t per_vertex_slots = prog->info.inputs_read; + uint32_t per_patch_slots = prog->info.patch_inputs_read; + memset(key, 0, sizeof(*key)); key->program_string_id = tep->id; @@ -251,11 +250,10 @@ brw_tes_populate_key(struct brw_context *brw, * TES (possibly for cross-thread communication). These need to * be stored in the Patch URB Entry as well. */ - if (brw->tess_ctrl_program) { - per_vertex_slots |= - brw->tess_ctrl_program->Base.nir->info->outputs_written; - per_patch_slots |= - brw->tess_ctrl_program->Base.nir->info->patch_outputs_written; + if (tcp) { + struct gl_program *tcp_prog = &tcp->program.Base; + per_vertex_slots |= tcp_prog->info.outputs_written; + per_patch_slots |= tcp_prog->info.patch_outputs_written; } /* Ignore gl_TessLevelInner/Outer - we treat them as system values, |