The state table, as may have been described elsewhere, is not very friendly to modern CPUs (due to its indirect calls). Additionally, interdependencies between states are often more obscure (or at least harder to account for) than they might be with a linear function.
Hence, we'd like to transform the table into a linear function, with "dirty" state guarding explicitly spelled out. For the FFP tables, the approach I've taken to achieve this is to gradually move states out of the table and into the existing vp_enable() and fp_enable() functions, eventually making those functions the aforementioned single linear functions.
-- v3: wined3d/arb: Move fragment program compilation from fragment_prog_arbfp() to arbfp_apply_draw_state(). wined3d: Pass a non-const wined3d_context pointer to the FFP *_apply_draw_state() methods. wined3d: Pass a wined3d_state pointer to the vp_enable() and fp_enable() methods. wined3d: Introduce a separate fp_disable() method. wined3d: Introduce a separate vp_disable() method. wined3d: Merge shader_load_constants() into shader_select().