Commit 865eee3d authored by hybrid's avatar hybrid

Avoid problem with buggy driver returns

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4263 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 424d87e8
...@@ -94,6 +94,8 @@ COpenGLSLMaterialRenderer::~COpenGLSLMaterialRenderer() ...@@ -94,6 +94,8 @@ COpenGLSLMaterialRenderer::~COpenGLSLMaterialRenderer()
GLhandleARB shaders[8]; GLhandleARB shaders[8];
GLint count; GLint count;
Driver->extGlGetAttachedObjects(Program, 8, &count, shaders); Driver->extGlGetAttachedObjects(Program, 8, &count, shaders);
// avoid bugs in some drivers, which return larger numbers
count=core::min_(count,8);
for (GLint i=0; i<count; ++i) for (GLint i=0; i<count; ++i)
Driver->extGlDeleteObject(shaders[i]); Driver->extGlDeleteObject(shaders[i]);
Driver->extGlDeleteObject(Program); Driver->extGlDeleteObject(Program);
...@@ -105,6 +107,8 @@ COpenGLSLMaterialRenderer::~COpenGLSLMaterialRenderer() ...@@ -105,6 +107,8 @@ COpenGLSLMaterialRenderer::~COpenGLSLMaterialRenderer()
GLuint shaders[8]; GLuint shaders[8];
GLint count; GLint count;
Driver->extGlGetAttachedShaders(Program2, 8, &count, shaders); Driver->extGlGetAttachedShaders(Program2, 8, &count, shaders);
// avoid bugs in some drivers, which return larger numbers
count=core::min_(count,8);
for (GLint i=0; i<count; ++i) for (GLint i=0; i<count; ++i)
Driver->extGlDeleteShader(shaders[i]); Driver->extGlDeleteShader(shaders[i]);
Driver->extGlDeleteProgram(Program2); Driver->extGlDeleteProgram(Program2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment