[osg-users] [Toward DrawElementBaseVertex as drawcall]
Julien Valentin
julienvalentin51 at gmail.com
Sat Feb 18 12:55:37 PST 2017
up
(in order my post edits appear on the ML)
mp3butcher wrote:
> Hello Robert,
> I achieve a basevertex example and debug with nvidia gl debugger.
> https://github.com/mp3butcher/OpenSceneGraph/tree/master/examples/osgSharedVAO
> It appears that glBindVertexArrayObject seams to have a cost 500ns !? when big bufferobjects are involved in the vas
> Sure bos are remapped at each call...
>
> I added a check not to call glBindVertexArrayObject when currentvaobound doesn't change and achieve the same perf as my rejected submission (a near 0 draw submission overhead )
>
> Code:
> void VertexArrayState::bindVertexArrayObject() const {
> if(_state->getCurrentBoundVAO()!=_vertexArrayObject){
> _state->setCurrentBoundVAO(_vertexArrayObject);
> _ext->glBindVertexArray (_vertexArrayObject);
> }
> }
>
> void VertexArrayState::unbindVertexArrayObject() const {
> no overhead here if(_state->getCurrentBoundVAO()!=0){
> _state->setCurrentBoundVAO(0);
> _ext->glBindVertexArray (0);
> }
> }
> ////and inlined mutable property get/setBoundVAO in osg/State
>
>
>
> It's not very elegant but it do the job.
>
> Bench with a DrawArrays low res sparse buildings scene:
> (on a NVGTX660OC)
> 1VAO/Geom: DrawCost 4
> shared VAOs: DrawCost 2
>
> Bench with a DrawElementShort BigCity scene:
> https://drive.google.com/file/d/0BxIH-jcsgYDdTG5ha21HZE1jX1E/view
> 1VAO/Geom: DrawCost 9
> shared VAOs: DrawCost 4
>
>
> Any toughts about it?
>
> Cheers
>
>
> robertosfield wrote:
> > Hi Julien,
> >
> > On 6 February 2017 at 10:33, Julien Valentin <> wrote:
> >
> > > I remember your rejection, but it's not what I asked.
> > > I would like your sentiment about what the book extract says about efficient draw submission and basevertex based drawcall....
> > >
> >
> > Personally I have plenty of more pressing things to work on the OSG
> > than chase after a possible small benefit. For OSG-3.6 my focus will
> > be completing my work on fixed function -> shader pipeline and fixing
> > bugs.
> >
> > Please remember these potential gains are in the wider context of real
> > application with a wider range of different potential bottlenecks,
> > typically the CPU and GPU bottlenecks be such that you may not see
> > expected benefits.
> >
> > The right way to optimize graphics applications is benchmark test
> > cases that most closely follow the needs that your
> > application/OS/hardware with require when dealing with real datasets.
> > Narrow benchmarks won't typically reveal what bottlenecks the full
> > application and full data will see so you have to be very careful
> > about extrapolating possible bottlenecks. With the full application
> > and data tests you get a real picture of the what are the biggest
> > bottlenecks and these are ones that you will see the most benefit from
> > optimizing.
> >
> > Given this context I would be sceptical about how much value will see
> > in sharing VAO and using base vertex. With anything that adds
> > complexity to the API and implementation you need to make sure there
> > is real value in added them to justify this complexity.
> >
> > Robert.
> > _______________________________________________
> > osg-users mailing list
> >
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> > ------------------
> > Post generated by Mail2Forum
>
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70270#70270
More information about the osg-users
mailing list