Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by littlekid Mar 12, 2011 at 12:20 PM 1 replies 800+ views
Original Post
littlekid
littlekid
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
Nanoha
Nanoha
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.
Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.
Excors
Excors
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]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.