Hi,
As a follow up to the mail from last Sunday I now have a concrete implementation suggestion for an infrastructure for a fixed function pipeline replacement:
What it mainly does is that it makes the state table a property of the shader backend, as well as the shader caps to keep GetDeviceCaps simpler. It also adds rudimentary functions for comparing the fixed function fragment processing settings. As an example implementation, the patchset is constructed around a fragment pipeline implementation using GL_ATI_fragment_shader.
What is missing is dealing with vertex states, Henri has some code for that already. The data structure and comparison of pipeline states needs optimization. The already existing pipeline replacement using GL_NV_register_combiners and GL_NV_texture_shader should be moved into a separate shader backend. And obviously an implementation of vertex and fragment pipeline using ARB shaders and GLSL(that could be done as a gsoc project maybe)
The GL_ATI_fragment_shader code is constructed bottom-up, so if the patches are applied as-is, it will lead to a temporary regression on ATI cards. Inverting this would be a major pain, so when sending it in I'll keep the extension disabled in patch 1, and enable it in a final last patch.
The GL_NV_* stuff will work a bit different than atifs, arb and glsl, since we can configure all texture stages individually, so a stored program and state comparison is not needed. Instead we can keep the set_tex_op as it is, but the if(GL_SUPPORTED(...)) checks and related nastiness can be factored out. Maybe we can also get rid of setting up the texunit map every draw in some cases.