Jump to content

  • Log In with Google      Sign In   
  • Create Account

melbow

Member Since 16 Feb 2009
Offline Last Active May 18 2014 03:20 AM

#5020600 Advanced Render Queue API

Posted by melbow on 11 January 2013 - 10:30 PM

Thanks again Hodgman. I really appreciate how detailed yet concise your responses are. The only thing that is still not completely clear to me is the generation of RenderItems. Are they allocated each frame from a data cache (like what is described here http://docs.madewithmarmalade.com/native/api_reference/iwgxapidocumentation/iwgxapioverview/datacache.html )? And would a higher level object like a GLShader or GeometryPacket class then maintain their respective Commands? I am not seeing a way to to check for duplicate states by comparing pointers unless the Commands are maintained by global, shared resources, or I guess if Commands ARE global shared resources, but the first option seems cleaner.

Again, I really appreciate everyone's input on this thread, it has helped me a great deal.


#5014614 Advanced Render Queue API

Posted by melbow on 27 December 2012 - 12:37 AM

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:

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.




PARTNERS