Fixed warning with AMD drivers

Occured when deleting a shader created by a deleted context, but since
shaders are shareable, this should not be an issue (OpenGL 4.2: D.1.1)


Former-commit-id: 2427ec045bbb9d7415aaa4f8670b724601a07fe3
This commit is contained in:
Lynix 2013-06-23 13:17:39 +02:00
parent 00c2e824d1
commit 3e82794b70
1 changed files with 3 additions and 7 deletions

View File

@ -165,12 +165,6 @@ void NzGLSLShader::Destroy()
for (auto it = m_textures.begin(); it != m_textures.end(); ++it)
it->second.texture->RemoveResourceListener(this);
for (GLuint shader : m_shaders)
{
if (shader)
glDeleteShader(shader);
}
NzOpenGL::DeleteProgram(m_program);
}
@ -252,7 +246,9 @@ bool NzGLSLShader::Load(nzShaderType type, const NzString& source)
if (success == GL_TRUE)
{
glAttachShader(m_program, shader);
glAttachShader(m_program, shader); // On attache le shader au programme
glDeleteShader(shader); // On le marque pour suppression (Lors de l'appel à glDeleteProgram)
m_shaders[type] = shader;
static NzString successStr("Compilation successful");