Added support for glObjectLabel debugging

This commit is contained in:
Robert Osfield
2016-11-15 14:35:47 +00:00
parent 4ecf541cb6
commit 1abd99f084
6 changed files with 66 additions and 1 deletions

View File

@@ -1182,6 +1182,8 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
glMaxTextureUnits = 0;
glMaxTextureCoords = 0;
}
osg::setGLExtensionFuncPtr(glObjectLabel, "glObjectLabel", validContext);
}

View File

@@ -824,6 +824,8 @@ void Program::PerContextProgram::linkProgram(osg::State& state)
OSG_INFO << "Program \""<< _program->getName() << "\" "<<
"link succeeded, infolog:\n" << infoLog << std::endl;
}
_extensions->debugObjectLabel(GL_PROGRAM, _glProgramHandle, _program->getName());
}
if (_extensions->isUniformBufferObjectSupported)

View File

@@ -716,6 +716,8 @@ void Shader::PerContextShader::compileShader(osg::State& state)
OSG_INFO << _shader->getTypename() << " Shader \""
<< _shader->getName() << "\" infolog:\n" << infoLog << std::endl;
}
_extensions->debugObjectLabel(GL_SHADER, _glShaderHandle, _shader->getName());
}
}

View File

@@ -715,7 +715,7 @@ osg::ref_ptr<Texture::TextureObject> TextureObjectSet::takeFromOrphans(Texture*
osg::ref_ptr<Texture::TextureObject> TextureObjectSet::takeOrGenerate(Texture* texture)
{
// see if we can recyle TextureObject from the orphan list
// see if we can recycle TextureObject from the orphan list
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
if (!_pendingOrphanedTextureObjects.empty())
@@ -1864,6 +1864,13 @@ void Texture::applyTexParameters(GLenum target, State& state) const
const unsigned int contextID = state.getContextID();
const GLExtensions* extensions = state.get<GLExtensions>();
TextureObject* to = getTextureObject(contextID);
if (to)
{
extensions->debugObjectLabel(GL_TEXTURE, to->id(), getName());
}
WrapMode ws = _wrap_s, wt = _wrap_t, wr = _wrap_r;
// GL_IBM_texture_mirrored_repeat, fall-back REPEAT