I am trying to offer support for generic attributes in display lists. Problem is, display lists dereference vertex attributes at compile time, including their location indices.
In the non-display list path, I do the following:-
1. render mesh... 1.1 query the currently bound shader. 1.2 if this mesh hasn't encountered this shader before... 1.2.1 enumerate the shaders active attributes (names/types/size etc.). 1.2.2 for any attributes that match the meshes attributes, I get their location and cache it as a coupling structure between the mesh and that particular shader. 1.3 fetch the coupling structure for this mesh/shader combo. 1.4 bind the attributes to the cached location indices.
So the mesh has a unique location list for each shader its rendered with.
But that isn’t possible with display lists. I’d have to have a unique compilation of the display list for each shader.
Is there any way around this? another design pattern perhaps?
Thanks for any help offered.