[Mesa-dev] [PATCH] i965: Drop redundant key->outputs_written initialization.

Kenneth Graunke kenneth at whitecape.org
Tue Dec 6 20:41:44 UTC 2016


This was already set to the same value earlier.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_tcs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 95926db..76cd0a5 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -317,62 +317,60 @@ brw_tcs_populate_key(struct brw_context *brw,
 
    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 (tcp) {
       struct gl_program *prog = &tcp->program;
       per_vertex_slots |= prog->info.outputs_written;
       per_patch_slots |= prog->info.patch_outputs_written;
    }
 
    if (brw->gen < 8 || !tcp)
       key->input_vertices = brw->ctx.TessCtrlProgram.patch_vertices;
    key->outputs_written = per_vertex_slots;
    key->patch_outputs_written = per_patch_slots;
 
    /* We need to specialize our code generation for tessellation levels
     * based on the domain the DS is expecting to tessellate.
     */
    key->tes_primitive_mode = tep->program.info.tes.primitive_mode;
    key->quads_workaround = brw->gen < 9 &&
                            tep->program.info.tes.primitive_mode == GL_QUADS &&
                            tep->program.info.tes.spacing == GL_EQUAL;
 
    if (tcp) {
       key->program_string_id = tcp->id;
 
       /* _NEW_TEXTURE */
       brw_populate_sampler_prog_key_data(&brw->ctx, &tcp->program, &key->tex);
-   } else {
-      key->outputs_written = tes_prog->info.inputs_read;
    }
 }
 
 void
 brw_upload_tcs_prog(struct brw_context *brw)
 {
    struct gl_shader_program **current = brw->ctx._Shader->CurrentProgram;
    struct brw_stage_state *stage_state = &brw->tcs.base;
    struct brw_tcs_prog_key key;
    /* BRW_NEW_TESS_PROGRAMS */
    struct brw_program *tcp = (struct brw_program *) brw->tess_ctrl_program;
    MAYBE_UNUSED struct brw_program *tep =
       (struct brw_program *) brw->tess_eval_program;
    assert(tep);
 
    if (!brw_state_dirty(brw,
                         _NEW_TEXTURE,
                         BRW_NEW_PATCH_PRIMITIVE |
                         BRW_NEW_TESS_PROGRAMS))
       return;
 
    brw_tcs_populate_key(brw, &key);
 
    if (!brw_search_cache(&brw->cache, BRW_CACHE_TCS_PROG,
                          &key, sizeof(key),
                          &stage_state->prog_offset,
                          &brw->tcs.base.prog_data)) {
       bool success = brw_codegen_tcs_prog(brw, current[MESA_SHADER_TESS_CTRL],
                                           tcp, &key);
       assert(success);
-- 
2.10.2



More information about the mesa-dev mailing list