Let me preface this by saying I have read everything I could find on the web on this topic, but have been unable to answer my question.
This list includes most notably:
- http://realtimecollisiondetection.net/blog/?p=86http://realtimecollisiondetection.net/blog/?p=86
- http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter05.html
- http://www.gamedev.net/topic/604899-frostbite-rendering-architecture-question/
- http://www.gamedev.net/topic/605065-renderqueue-design-theory-and-implementation/#entry4828468
- http://www.gamedev.net/topic/602839-whats-the-point-of-having-a-single-render-device/#entry4815585
I understand sorting the draw calls and how to use this system under the fixed-function pipeline. However, when I change to a programmable pipeline, I can't seem to come up with how a "Render Operation" would be structured.
The best solution I could come up with was an object list for both uniforms and attributes. However, I can't see how a VAO or VBO would fit into this scheme.
Roughly, my code might look like:
class ShaderProgram {
public:
void Create(char*,char*);
void MakeCurrent();
ShaderAttributeInfo const & GetAttribute(const char* name);
...
private:
List<ShaderAttributeInfo> m_Attributes;
List<ShaderUniformInfo> m_Uniforms;
};
class ShaderAttribInfo {
GLint handle;
GLenum type;
public:
Set(void* data);
};
class ShaderAttrib {
ShaderAttribInfo* info;
void* data;
...
};
... // Same basic structure for Uniforms
class RenderOperation {
List<ShaderAttrib> m_Attributes;
List<ShaderUniform> m_Uniforms;
ShaderProgram* m_Program;
};
I'm trying to make my system as versatile, yet efficient as possible.
To reiterate, my question is: How would a "Render Operation" be formatted for a Render Queue using a programmable pipeline? The operation should allow for any sort of uniform or attribute and allow for VAOs and VBOs. And I don't feel the need to support a fixed function pipeline, so don't worry about that.
I hope I made my confusion clear enough. Thanks a ton.