Game Development Community

OpenGL extension: GL_EXT_vertex_buffer?

by asmaloney (Andy) · in Torque Game Engine · 02/19/2007 (4:11 pm) · 8 replies

As I was working through some things for my optimization kit, I ran across an OpenGL extension which doesn't seem to exist: GL_EXT_vertex_buffer.

It looks like it is supposed to be a VBO thing, but I find no reference to it anywhere on the net. It's only checked on the Mac side of things and there a comment saying it's deprecated.
// EXT_vertex_buffer ========================================
      // This extension is deprecated, and not supported by Apple. ( 10.4.3 )
      // Instead, the ARB Vertex Buffer extension is supported.
      // The new extension has a different API, so TGE should be updated to use it.

It seems that for all platforms, dglDoesSupportVertexBuffer() - which checks gGLState.suppVertexBuffer - will always be false and any code using it [interiorLMManager.cc, interiorRender.cc, terrData.cc, terrRender.cc, tsShape.cc, and tsShapeInstance.cc] may be simplified.

Any reason not to do this? [VBOs have been implemented by Alex in his Modernization Kit, but he's using gGLState.suppARBVertexBuffer and dglDoesSupportARBVertexBuffer() to check for it.]

#1
02/19/2007 (4:18 pm)
This is actually a faux GL extension which is implemented by the D3D wrapper. It has no OpenGL basis at all.
#2
02/19/2007 (4:30 pm)
Thanks Pat - that comment's a bit misleading then. Explains why I can't find anything on it :-)

I've looked through everything and can't see that it's actually used - even on the D3D side. As far as I can tell dglDoesSupportVertexBuffer() can never be true. Am I missing something?
#3
02/20/2007 (10:43 am)
It is/was used in (at least) TSShape rendering. It *may* have been used other places. Look for glAllocateVertexBufferEXT, glLockVertexBufferEXT, and other calls like that.
#4
02/20/2007 (11:15 am)
It looks like all paths leading to any of those calls are checked with dglDoesSupportVertexBuffer() which is always false. Is this an oversight or just crufty code?

[Actually, gGLState.suppVertexBuffer is never explicitly set on Windows. On the Mac, gGLState is cleared with a memset in getGLCapabilities() before starting out, but not on Windows. I assume it's relying on the compiler to initialize it?]
#5
02/20/2007 (12:04 pm)
It's not always false; it's always false if you are using GL, it will return true if you are using the D3D wrapper. (or it should) It is possible that the check was removed to set that flag when loading GL extensions, however if you query the D3D dll for it's GL extentions, "GL_EXT_vertex_buffer" will be returned, and the value of 'suppVertexBuffer' in the GL state should be set to true.
#6
02/20/2007 (12:27 pm)
OK then there is some code missing in platformWin32/platformGL.h because gGLState.suppVertexBuffer is never set and "GL_EXT_vertex_buffer" is never checked for in platformWin32/winGL.cc.

maloney$ find . -type f | xargs grep suppVertexBuffer
./platformMacCarb/macCarbGL.cc:         gGLState.suppVertexBuffer = true;
./platformMacCarb/platformGL.h:   bool suppVertexBuffer;
./platformWin32/platformGL.h:   bool suppVertexBuffer;
./platformWin32/platformGL.h:   return gGLState.suppVertexBuffer;
./platformX86UNIX/platformGL.h:        bool suppVertexBuffer;
./platformX86UNIX/platformGL.h:        return gGLState.suppVertexBuffer;
#7
02/20/2007 (1:18 pm)
Urgh. This is an interesting find. What release/product are you running on? It would be my guess that whatever release that is, TS rendering is broken in D3D.
#8
02/20/2007 (1:25 pm)
This is TGE 1.5. I took a quick look at 1.4.2 and it looks like it has the same problem.

[Edit: 1.4.2]