diff options
author | Kenneth Graunke <[email protected]> | 2015-12-15 03:04:50 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-12-22 17:21:59 -0800 |
commit | 8498cb4a45e8ed53a2ee2b35d3c2cbb9963e1756 (patch) | |
tree | bfbac178730c3fa332f288ce708df1f1e972bf1c /src/mesa/drivers/dri/i965/brw_tcs.c | |
parent | 2bcf98940703bee4485e323f4a9e28e2c6fe41fd (diff) |
i965: Only call brw_upload_tcs/tes_prog when using tessellation.
If there's no evaluation shader, tessellation is disabled. The upload
functions would just bail. Instead, don't bother calling them.
This will simplify the optional-TCS case a bit, as brw_upload_tcs can
assume that we're doing tessellation.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_tcs.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_tcs.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c index b5eb4cdde5e..037a2da7681 100644 --- a/src/mesa/drivers/dri/i965/brw_tcs.c +++ b/src/mesa/drivers/dri/i965/brw_tcs.c @@ -187,6 +187,10 @@ brw_upload_tcs_prog(struct brw_context *brw) /* BRW_NEW_TESS_CTRL_PROGRAM */ struct brw_tess_ctrl_program *tcp = (struct brw_tess_ctrl_program *) brw->tess_ctrl_program; + /* BRW_NEW_TESS_EVAL_PROGRAM */ + struct brw_tess_eval_program *tep = + (struct brw_tess_eval_program *) brw->tess_eval_program; + assert(tcp && tep); if (!brw_state_dirty(brw, _NEW_TEXTURE, @@ -195,15 +199,6 @@ brw_upload_tcs_prog(struct brw_context *brw) BRW_NEW_TESS_EVAL_PROGRAM)) return; - if (tcp == NULL) { - /* Other state atoms had better not try to access prog_data, since - * there's no HS program. - */ - brw->tcs.prog_data = NULL; - brw->tcs.base.prog_data = NULL; - return; - } - struct gl_program *prog = &tcp->program.Base; memset(&key, 0, sizeof(key)); @@ -216,13 +211,9 @@ brw_upload_tcs_prog(struct brw_context *brw) brw_populate_sampler_prog_key_data(ctx, prog, stage_state->sampler_count, &key.tex); - /* BRW_NEW_TESS_EVAL_PROGRAM */ /* We need to specialize our code generation for tessellation levels * based on the domain the DS is expecting to tessellate. */ - struct brw_tess_eval_program *tep = - (struct brw_tess_eval_program *) brw->tess_eval_program; - assert(tep); key.tes_primitive_mode = tep->program.PrimitiveMode; if (!brw_search_cache(&brw->cache, BRW_CACHE_TCS_PROG, |