Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualmelbow

Posted 27 December 2012 - 12:42 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.


#2melbow

Posted 27 December 2012 - 12:38 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?

 

I hope I made my confusion clear enough. Thanks a ton.


#1melbow

Posted 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;
};

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?

 

I hope I made my confusion clear enough. Thanks a ton.


PARTNERS