GL: Implemented setName.

This commit is contained in:
Branimir Karadžić 2017-08-31 20:30:43 -07:00
parent 7ce23528e4
commit db671c2ee4
2 changed files with 22 additions and 1 deletions

View File

@ -2984,7 +2984,20 @@ namespace bgfx { namespace gl
virtual void setName(Handle _handle, const char* _name) override
{
BX_UNUSED(_handle, _name)
switch (_handle.type)
{
case Handle::Shader:
GL_CHECK(glObjectLabel(GL_SHADER, m_shaders[_handle.idx].m_id, -1, _name) );
break;
case Handle::Texture:
GL_CHECK(glObjectLabel(GL_TEXTURE, m_textures[_handle.idx].m_id, -1, _name) );
break;
default:
BX_CHECK(false, "Invalid handle type?! %d", _handle.type);
break;
}
}
void submitBlit(BlitState& _bs, uint16_t _view);

View File

@ -840,6 +840,14 @@ typedef uint64_t GLuint64;
# define GL_UPPER_LEFT 0x8CA2
#endif // GL_UPPER_LEFT
#ifndef GL_SHADER
# define GL_SHADER 0x82E1
#endif // GL_SHADER
#ifndef GL_TEXTURE
# define GL_TEXTURE 0x1702
#endif // GL_TEXTURE
// _KHR or _ARB...
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243