The instruction sets handled by ARB_vertex_program and ARB_fragment_program are nearly idential. They are even more similar when NV_vertex_program3 and NV_fragment_program2 are layered on them. The internal handling of the programs (i.e., the representation of the instructions and their parameters) should be unified.
Created attachment 3710 [details] [review] First pass at unifying vertex and fragment program handling The old {fp,vp}_{program,src_register,dst_register} structures were merged into new prog_{program,src_register,dst_register} structures. This adds about 80 lines of code, but pretty much all of the added lines are comments. I have verified that this code works with serveral of the vertex and fragment programs in progs/tests. The next step is to refactor some of the code that operates on these structures.
Created attachment 3711 [details] [review] Second pass at unifying vertex and fragment program handling This patch fixes a problem with the number of bits allocated to Precision in the previous patch. It also replaces _mesa_init_(vp|fp)_instruction with _mesa_init_instruction. This eliminates about 20 lines of code versus the previous patch.
Ian, I'm working on the same thing. I'll see about merging your changes with my local changes...
I've checked in your patch, plus unification of the vertex/fragment program opcodes. Closing this report now, though there's more follow-on work to be done, like unifying struct vertex_program and struct fragment_program (or at least moving common fields into the base program class).
Mass version move, cvs -> git
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.