Commit ec18612b authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'release-check-handle-after-shader-creation' into release

6d8539d7

 Handle shader creation failures
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Ken Martin's avatarKen Martin <ken.martin@kitware.com>
Merge-request: !5702
parents 3bea923b 6d8539d7
......@@ -72,6 +72,14 @@ bool vtkShader::Compile()
}
GLuint handle = glCreateShader(type);
// Handle shader creation failures.
if (handle == 0)
{
this->Error = "Could not create shader object.";
return false;
}
const GLchar *source = static_cast<const GLchar *>(this->Source.c_str());
glShaderSource(handle, 1, &source, nullptr);
glCompileShader(handle);
......
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