[osg-submissions] RE : Re: About the Warning: detected OpenGL error 'invalid value' after RenderBin::draw(, )

Art Tevs stud_info2 at yahoo.de
Fri May 9 03:16:44 PDT 2008


Hi Franclin,

Ok, you are not the first one with this warning. On my
machines I always do change this file as soon as I
grab new osg version ;)

Robert, I think, you should submit the patch and we
will just waiting for results of the community if they
will encounter any problems. However I am pretty sure,
that they wouldn't.

regards,
Art


--- Franclin Foping <fsfoping at yahoo.fr> schrieb:

> Hi Art,
>  I have tried your patch and everything seems to be
> working fine. Thanks a lot for your help.
>  Regards,
>  Franclin.
> 
> Art Tevs <stud_info2 at yahoo.de> a écrit : Hi Robert, 
> 
> here is the patched Program.cpp file again. If there
> will be no complains you can submit it. 
> 
> As I wrote in my first submission about this patch
> (couple of months ago): 
> - For people who do not use geometry shaders, this
> patch wouldn't break any functionality, because no
> geometry output is generated.
> 
> - For people who use geometry shaders this patch
> will
> also do not bring any potential problems, because
> they
> have to redefine the "problematic value" anyway.
> 
> Hence I still do not see any drawbacks to use this
> patch ;-)
> 
> 
> Best regards,
> Art
> 
> 
> 
> 
>       Machen Sie Yahoo! zu Ihrer Startseite. Los
> geht's: 
> http://de.yahoo.com/set/* -*-c++-*- OpenSceneGraph -
> Copyright (C) 1998-2006 Robert Osfield 
>  * Copyright (C) 2003-2005 3Dlabs Inc. Ltd.
>  * Copyright (C) 2004-2005 Nathan Cournia
>  * Copyright (C) 2008 Zebra Imaging
>  *
>  * This application is open source and may be
> redistributed and/or modified   
>  * freely and without restriction, both in
> commericial and non commericial
>  * applications, as long as this copyright notice is
> maintained.
>  * 
>  * This application is distributed in the hope that
> it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the
> implied warranty of
>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>  *
> */
> 
> /* file:        src/osg/Program.cpp
>  * author:      Mike Weiblen 2008-01-19
> */
> 
> #include 
> 
> 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> #include 
> #include 
> 
> using namespace osg;
> 
>
///////////////////////////////////////////////////////////////////////////
> // static cache of glPrograms flagged for deletion,
> which will actually
> // be deleted in the correct GL context.
> 
> typedef std::list GlProgramHandleList;
> typedef osg::buffered_object DeletedGlProgramCache;
> 
> static OpenThreads::Mutex   
> s_mutex_deletedGlProgramCache;
> static DeletedGlProgramCache
> s_deletedGlProgramCache;
> 
> void Program::deleteGlProgram(unsigned int
> contextID, GLuint program)
> {
>     if( program )
>     {
>         OpenThreads::ScopedLock
> lock(s_mutex_deletedGlProgramCache);
> 
>         // add glProgram to the cache for the
> appropriate context.
>        
>
s_deletedGlProgramCache[contextID].push_back(program);
>     }
> }
> 
> void Program::flushDeletedGlPrograms(unsigned int
> contextID,double /*currentTime*/, double&
> availableTime)
> {
>     // if no time available don't try to flush
> objects.
>     if (availableTime<=0.0) return;
> 
>     OpenThreads::ScopedLock
> lock(s_mutex_deletedGlProgramCache);
>     const GL2Extensions* extensions =
> GL2Extensions::Get(contextID,true);
>     if( ! extensions->isGlslSupported() ) return;
> 
>     const osg::Timer& timer =
> *osg::Timer::instance();
>     osg::Timer_t start_tick = timer.tick();
>     double elapsedTime = 0.0;
> 
>     {
> 
>         GlProgramHandleList& pList =
> s_deletedGlProgramCache[contextID];
>         for(GlProgramHandleList::iterator
> titr=pList.begin();
>             titr!=pList.end() && elapsedTime
>             )
>         {
>             extensions->glDeleteProgram( *titr );
>             titr = pList.erase( titr );
>             elapsedTime =
> timer.delta_s(start_tick,timer.tick());
>         }
>     }
> 
>     availableTime -= elapsedTime;
> }
> 
> void Program::discardDeletedGlPrograms(unsigned int
> contextID)
> {
>     OpenThreads::ScopedLock
> lock(s_mutex_deletedGlProgramCache);
>     GlProgramHandleList& pList =
> s_deletedGlProgramCache[contextID];
>     pList.clear();
> }
> 
> 
>
///////////////////////////////////////////////////////////////////////////
> // osg::Program
>
///////////////////////////////////////////////////////////////////////////
> 
> Program::Program() :
>     _geometryVerticesOut(1),
> _geometryInputType(GL_TRIANGLES),
>     _geometryOutputType(GL_TRIANGLE_STRIP)
> {
> }
> 
> 
> Program::Program(const Program& rhs, const
> osg::CopyOp& copyop):
>     osg::StateAttribute(rhs, copyop)
> {
>     osg::notify(osg::FATAL) << "how got here?" <<
> std::endl;
>     _geometryVerticesOut = rhs._geometryVerticesOut;
>     _geometryInputType = rhs._geometryInputType;
>     _geometryOutputType = rhs._geometryOutputType;
> }
> 
> 
> Program::~Program()
> {
>     // inform any attached Shaders that we're going
> away
>     for( unsigned int i=0; i < _shaderList.size();
> ++i )
>     {
>         _shaderList[i]->removeProgramRef( this );
>     }
> }
> 
> 
> int Program::compare(const osg::StateAttribute& sa)
> const
> {
>     // check the types are equal and then create the
> rhs variable
>     // used by the COMPARE_StateAttribute_Parameter
> macro's below.
>     COMPARE_StateAttribute_Types(Program,sa)
>     
>     if( _shaderList.size() < rhs._shaderList.size()
> ) 
=== message truncated ===>
_______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> 



      Nicht vergessen! Am Sonntag, den 11. Mai ist Muttertag 
Geschenkideen, Gedichte & mehr: www.yahoo.de/muttertag


More information about the osg-submissions mailing list