Hi guys,

On 5/04/12 6:05 , Martin Naylor wrote:
> I see no Nvdia dll in the call stack, not sure if I should, so am thinking
> an OSG problem(please take with a pinch of salt).

Without having encountered that crash this to me would indicate that the crash 
is
happening in GL code (such as glGetActiveUniforms) rather than the surrounding 
setup.

> So I have had a go at debugging, its beyond me but a couple of questions to
> help me in my pursuit.
> The call before the crash in the vector stl lib is:
> 
>     if (_extensions->isShaderAtomicCounterSupported())
>     {
>         std::vector<GLint> bufferIndex( atomicCounterMap.size(), 0 );
>         std::vector<GLuint> uniformIndex;
>         for (AtomicCounterMap::iterator it = atomicCounterMap.begin(), end =
> atomicCounterMap.end();
>              it != end; ++it)
>         {
>             uniformIndex.push_back(it->first);
>         }
> 
>         _extensions->glGetActiveUniformsiv( _glProgramHandle,
> uniformIndex.size(),
>                                             &(uniformIndex[0]),
> GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX,
>                                             &(bufferIndex[0]) );
> 
> 
> The above is doing a for loop and pushing the first item back, whilst
> debugging the 'end' has a bad_ptr, is this correct?
> Also why ++it and not it++ ?

Can you verify that 'uniformIndex' and 'bufferIndex' are *ALWAYS* non-empty?  
Otherwise
the '&uniformIndex[0]' will definitively cause a crash.

If that cannot be assured then we need a bit of

if (!uniformIndex.empty() && !bufferIndex.empty())
{
   // glGetActiveUniform()
}

Not sure why 'end' is bad, that certainly shouldn't be the case unless the
atomicCounterMap is not properly set up.

'++it' is a sort of code optimization hint to the compiler and may-or-may-not 
produce
faster code; the end result is the same.

Cheers,
/ulrich
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to