OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Vertex Buffer Object used inside display list


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
scrawl
Appreciator


Joined: 14 Dec 2014
Posts: 175

PostPosted: Thu Feb 16, 2017 9:14 pm    Post subject:
Vertex Buffer Object used inside display list
Reply with quote

Hi,

I've noticed some odd API usage in the OSG that seems to have started with the VAO support changes in OSG 3.5. Vertex buffer objects are being used inside a display list. This happens on a standard Geometry with default settings. Example:

glNewList(6, GL_COMPILE)
glGenBuffers(1, [5])
glBindBuffer(GL_ARRAY_BUFFER, 5)
glBufferData(...)
glBufferSubData(...) x4
glVertexPointer(3, GL_FLOAT, 0, NULL)
glNormalPointer(GL_FLOAT, 0, 0x90)
glColorPointer(4, GL_FLOAT, 0x180)
glTexCoordPointer(2, GL_FLOAT, 0, 0x120)
glDrawElements(...)
glBindBuffer(GL_ARRAY_BUFFER, 0)
glEndList()

The source of this change in behavior is here: https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osg/Geometry.cpp#L187 OSG will now always assign VBOs, even if they weren't requested.

First off all I find this usage very odd. The GL standard doesn't actually specify what is supposed to happen to VBOs in a display list - is the VBO simply ignored or could that cause a new VBO to be created with every call to the display list? Even if this works, the calls are completely redundant and could be removed.

More importantly, though, and the reason I'm bringing it up, is that this usage seems to be causing a crash with some versions of Mesa drivers, and the crash goes away when I disable display lists.

Ubuntu 14.04 - Nvidia: works
Ubuntu 14.04 - Intel HD: broken
Ubuntu 16.04 - Intel HD: broken

I've attached a minimal-ish apitrace you can use to see if your driver is affected - run it with 'apitrace replay <file>' , if you get 'caught signal 11' that means the driver has crashed.

Cheers,
Jannik
Back to top
View user's profile Send private message
scrawl
Appreciator


Joined: 14 Dec 2014
Posts: 175

PostPosted: Thu Feb 16, 2017 9:24 pm    Post subject:
Reply with quote

On Nvidia, replaying the trace prints the following debug output for each 'glDrawElements' line:

Code:
usnknown (sic) severity API unknown issue 131185, Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ARRAY_BUFFER_BINDING_ARB, GL_TEXCOORD_ARRAY_BUFFER_BINDING_ARB (0), and GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.


Not sure what this means exactly but I'd guess the VBO is first uploaded to the graphics card, then downloaded again to later re-upload into the display list? That sounds like while Nvidia accepts this behavior, it isn't recommending it from a performance standpoint.
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12263

PostPosted: Fri Feb 17, 2017 9:22 am    Post subject:
Vertex Buffer Object used inside display list
Reply with quote

Hi Jannik,

I had to change the code to always assign a VertexBufferObject as I
couldn't find a way of implementing VAO without forcing changes to
client code, in order to make sure the OSG works on GLcore profile
implementations that require VAO all arrays have to have a
VertexBufferObject.

The observation that display lists are being used the VBO side shows a
bug, display lists and VBO shouldn't be invoked though, we'll need to
review osg::Geometry to make sure VBO's aren't used when display lists
are being generated..

Robert.

On 16 February 2017 at 21:14, Jannik Heller <> wrote:
Quote:
Hi,

I've noticed some odd API usage in the OSG that seems to have started with the VAO support changes in OSG 3.5. Vertex buffer objects are being used inside a display list. This happens on a standard Geometry with default settings. Example:

glNewList(6, GL_COMPILE)
glGenBuffers(1, [5])
glBindBuffer(GL_ARRAY_BUFFER, 5)
glBufferData(...)
glBufferSubData(...) x4
glVertexPointer(3, GL_FLOAT, 0, NULL)
glNormalPointer(GL_FLOAT, 0, 0x90)
glColorPointer(4, GL_FLOAT, 0x180)
glTexCoordPointer(2, GL_FLOAT, 0, 0x120)
glDrawElements(...)
glBindBuffer(GL_ARRAY_BUFFER, 0)
glEndList()

The source of this change in behavior is here: https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osg/Geometry.cpp#L187 OSG will now always assign VBOs, even if they weren't requested.

First off all I find this usage very odd. The GL standard doesn't actually specify what is supposed to happen to VBOs in a display list - is the VBO simply ignored or could that cause a new VBO to be created with every call to the display list? Even if this works, the calls are completely redundant and could be removed.

More importantly, though, and the reason I'm bringing it up, is that this usage seems to be causing a crash with some versions of Mesa drivers, and the crash goes away when I disable display lists.

Ubuntu 14.04 - Nvidia: works
Ubuntu 14.04 - Intel HD: broken
Ubuntu 16.04 - Intel HD: broken

I've attached a minimal-ish apitrace you can use to see if your driver is affected - run it with 'apitrace replay <file>' , if you get 'caught signal 11' that means the driver has crashed.

Cheers,
Jannik

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70219#70219








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts adding object models in osgEarth best... Db80 General 10 Tue Apr 30, 2019 6:12 pm View latest post
No new posts Volume Rendering and Depth Buffer AnnieOwl General 5 Fri Apr 12, 2019 5:20 pm View latest post
No new posts Attaching color buffer with GL_R32F i... deroliver General 0 Tue Apr 09, 2019 6:19 pm View latest post
No new posts Make an object linked to camera moove... GiacomoB General 0 Wed Mar 20, 2019 9:45 am View latest post
No new posts Air-Traffic Surveillance Display usin... eskay187 Announcement [ANN] 2 Wed Feb 13, 2019 7:07 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP