Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Validating shader vertex format?

This topic is 2212 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I'm making a couple of changes to my material/shader system, as it's lacking some validation which I would find helpful. I've finished the shader uniform side, so if a material file (XML) includes a uniform name which doesn't exist in the shader, or it's data type doesn't match, it's able to detect this instead of continuing blindly.

I'm looking for a way to also validate the shader against a vertex buffer format - is anyone aware of a way to get this information out of a compiled shader? It would be great if the system could realise, for example, that a particular shader wants normals but the vertex buffer doesn't have them.

Thanks for any advice!


[Edit] Should have mentioned this is using OpenGL. Edited by Telios

Share this post

Link to post
Share on other sites
Which API are you using for rendering?
In D3D10 and D3D11 (I don't know about D3D9, but I assume a reflection API exists for that as well) you can use the shader reflection API to get information about the input signature of your shader.
You could store this signature in your shader/material structure so you can use it to validate your vertex buffer.


Ok, this obviously doesn't apply to OpenGL Edited by Radikalizm

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!