Jump to content
  • Advertisement
Sign in to follow this  
littlekid

Is it advisable or possible to use the same Buffer for index and vertex?

This topic is 2659 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

hi, I was wondering if it is possible to store indices and vertices on the same Buffer Object? For example I create a buffer object of size 1mb, and I write vertex data to say the first 512kb and write index data to the next 512kb?

Is it possible to do such thing, or would it be not advisable to do it?

I was thinking since I already have a buffer pool for vertex data, I might as well use it for indices too and even uniform data too.

regards

Share this post


Link to post
Share on other sites
Advertisement
I don't think its possible, I recall trying it. Don't remember exactly why but I never did it. The best I could get was a single element buffer and a single vertex buffer (with different parts for different materials etc). You should be able to put your uniform data in the vertex buffer, just not indices.

Share this post


Link to post
Share on other sites
It should be possible, but it's not advisable. The OpenGL 2.0 spec says:
Buffer objects created by binding an unused name to ARRAY_BUFFER and to ELEMENT_ARRAY_BUFFER are formally equivalent, but the GL may make different choices about storage implementation based on the initial binding. In some cases performance will be optimized by storing indices and array data in separate buffer objects, and by creating those buffer objects with the corresponding binding points.[/quote]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!