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

@@ -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