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:
parent
00c2e824d1
commit
3e82794b70
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue