The eventual goal for the HLSL FFP pipeline is to set the shader to an internally constructed wined3d_shader object early, so that all the existing backend logic that works with real shaders can be reused.
Specifically, we want to construct this shader before e.g. context_gl_load_shader_resources() and context_update_stream_info(), both functions which currently execute before applying state tables but which operate on the currently bound shaders. In fact, because the HLSL FFP pipeline is intended to be backend-agnostic, the goal is to construct the replacement shaders from within wined3d_cs_exec_draw().
This means that the "invalidate the FFP shader" flag—for which we simply reuse STATE_SHADER—needs to be set earlier, specifically before the draw call is submitted to the CS. Hence we do it from wined3d_device_apply_stateblock().