PDA

View Full Version : Display lists and VBO



aqnuep
01-29-2008, 12:13 PM
I have many questions related to display lists and VBOs, pros and contras, and concurrent use.

I'm storing my vertex and index data in buffer objects and it works well. I'm using glDrawElements.

My problem is that when I use glDrawElements between glNewList and glEndList, the program fails with an exception. I've read the specification and I know that index pointers are resolved in compile time of display lists, so passing a null pointer to the glDrawElements call between the glNewList and glEndList commands should be good if there are buffer objects bound to ARRAY_BUFFER and ELEMENT_ARRAY_BUFFER, but an access violation occurs when calling glDrawElements (accessing address 0x00000000).

I want to use display lists to improve batching, but now, I don't know what to do.

So my questions are the following:
- This could be an ATI driver bug, or I'm doing something wrong?
- Has anybody faced this issue or it is only my problem?
- Using display lists without VBO is less performant than using VBO without display lists?
- Is there another consistent way to create the same results?

Korval
01-29-2008, 12:20 PM
- This could be an ATI driver bug, or I'm doing something wrong?

In general, if your code would not fail if you remove the gl*List calls, but does fail when you use gl*List calls, it is either a driver bug or you are using a GL operation that is not valid between display lists. Use GLIntercept to find out which is true.


- Using display lists without VBO is less performant than using VBO without display lists?

There's no way to tell. In general, display lists are as optimal as the driver maker wants them to be. Since this is ATi, I wouldn't bet on it. I certainly wouldn't bet shipping code against it.

Basically, I'm saying that if you want consistent cross-platform performance, VBOs are you best bet.

Display lists, in order to conform to the spec, will have to copy your vertex data out of the buffer object anyway. So the building of the display list will probably take longer, since it will have to use the CPU to copy your vertex data out and then build its own internal buffers for it.

Zengar
01-29-2008, 12:52 PM
Another thing: there is no benefit of using VBO and display list (that is, create a list from an array in VBO), actually there is every possible reason to avoid it. AFAIK, the driver assembles the display lists on the CPU anyway.

aqnuep
01-30-2008, 05:47 AM
Thank you! I didn't even knew that compiling a draw command in a display list, that uses VBOs will actually load out the vertex data from the buffer object and store it in its own form.

The reason why I want to use display lists is to avoid issuing many OpenGL calls:
- switching textures, texture units, etc.
- many draw commands, because I have a large number of small geometries

What is the best way to make this optimal?