From: Paul Berry Date: Tue, 3 Sep 2013 18:55:17 +0000 (-0700) Subject: i965/fs: Simplify computation of key.input_slots_valid during precompile. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4546ec114853235db375b20fb47ddcd6a7f21e7;p=mesa.git i965/fs: Simplify computation of key.input_slots_valid during precompile. The for loop was rather silly. In addition to checking brw->gen < 6 on each loop iteration, it took pains to exclude bits from fp->Base.InputsRead that don't correspond to fragment shader inputs. But those bits would never have been set in the first place, since the only bits that are ever set in fp->Base.InputsRead are fragment shader inputs. Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 9cb79506326..004b3b55a2b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -3150,17 +3150,7 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog) } if (brw->gen < 6) - key.input_slots_valid |= BITFIELD64_BIT(VARYING_SLOT_POS); - - for (int i = 0; i < VARYING_SLOT_MAX; i++) { - if (!(fp->Base.InputsRead & BITFIELD64_BIT(i))) - continue; - - if (brw->gen < 6) { - if (_mesa_varying_slot_in_fs((gl_varying_slot) i)) - key.input_slots_valid |= BITFIELD64_BIT(i); - } - } + key.input_slots_valid = fp->Base.InputsRead | VARYING_BIT_POS; key.clamp_fragment_color = ctx->API == API_OPENGL_COMPAT;