Zengar, I like your last code sample
Perhaps something like a functional list processing language would be a good idea, because that would allow parallelism, too.
My original proposal would only work if we would allow the feedback loop to the vertex processing, but you’ve already convinced me earlier that this is no good idea.
But it is possible to place the same program before the vertex shader. Just take away the ability to read varyings and add the ability to write attributes. The interpolate method would still be useful, but there would be a vertex constructor, too.
The basic idea is that you have a program that takes a “mesh” as input and writes some vertices (or triangles) as output. The program is called once per mesh. But what should this “mesh” be? Clearly it should have some attributes. But we already have such a primitive: a vertex. This is why I proposed using vertices as input for the program. It’s not neccesary that the input vertices have anything to do with the output vertices, they could just contain arbitrary parameters used in the program.
About display lists: I don’t know what problem everybody has with display lists. They are just macros. If a display list doesn’t use geometry programs, there’s no difference. If geometry programs are hardware accelerated, so are display lists. And if geometry programs are in software and a display list uses them, there is no point in trying to execute the display list in hardware, as that’s not possible, no matter where in the pipeline geometry programs are located.
Finally some words about the list in the first post:
A1. Replace only evaluator functionality.
NO! Don’t confuse evaluation with tesselation. An evaluator is something that takes (u,v) as input and outputs (x,y,z). That’s the job of a vertex shader. The generation of a grid of (u,v) values in the range (0,0)-(1,1) is tesselation, this is what the geometry program should be able to do, and that’s what’s described in the second sentence of A1 (generating vertices).
A2. There are no byte-order issues.
When enabled, the vertices that are submitted by the usual methods (immediate mode, vertex arrays) are fed to the geometry shader.
IMHO no need for an additional call…
vertex: It would be a struct that has exactly the members that the vertex program expects as input attributes.
gl_Vertex[n]: The index would advance with every invokation of the program, how far could ideally be set somehow, with the simplest solution to just increase by the number of vertices that are used by the program (no overlap).