GL: Detach shaders after linking program.

This commit is contained in:
bkaradzic 2013-07-18 00:41:27 -07:00
parent ba1bd59488
commit 376bdf1b74
2 changed files with 3 additions and 0 deletions

View file

@ -63,6 +63,7 @@ GL_IMPORT(false, PFNGLCREATESHADERPROC, glCreateShader);
GL_IMPORT(false, PFNGLDELETEPROGRAMPROC, glDeleteProgram);
GL_IMPORT(false, PFNGLDELETESHADERPROC, glDeleteShader);
GL_IMPORT(false, PFNGLATTACHSHADERPROC, glAttachShader);
GL_IMPORT(false, PFNGLDETACHSHADERPROC, glDetachShader);
GL_IMPORT(false, PFNGLCOMPILESHADERPROC, glCompileShader);
GL_IMPORT(false, PFNGLSHADERSOURCEPROC, glShaderSource);
GL_IMPORT(false, PFNGLGETSHADERIVPROC, glGetShaderiv);

View file

@ -989,6 +989,8 @@ namespace bgfx
GL_CHECK(glAttachShader(m_id, _vsh.m_id) );
GL_CHECK(glAttachShader(m_id, _fsh.m_id) );
GL_CHECK(glLinkProgram(m_id) );
GL_CHECK(glDetachShader(m_id, _vsh.m_id) );
GL_CHECK(glDetachShader(m_id, _fsh.m_id) );
GLint linked = 0;
GL_CHECK(glGetProgramiv(m_id, GL_LINK_STATUS, &linked) );